-
解压mysql-5.7.10-linux-glibc2.5-x86_64.tar.gz,并更名为mysql,再放到/usr/local目录下
-
添加mysql用户和组,然后安装mysql并启动,初始密码由/root/.mysql_secret保存,使用的命令如下:
groupadd mysql
useradd mysql -g mysql
cd /usr/local/mysql/bin
yum install libaio
./mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data
cd /usr/local/mysql/support-files
./mysql.server start
-
使用初始密码登录mysql,并修改密码,同时设置root可以远程连接
命令如下:
cat /root/.mysql_secret
cd /usr/local/mysql/bin
./mysql -u root -p
set password =password('新密码');
GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "1新密码";
flush privileges;
可能远程连接不了,尝试关闭防火墙,命令如下:
service iptables stop
setenforce 0
-
sr将mysql设置为开机自启动,并添加软连接
命令如下:
cd /usr/local/mysql/support-files/
cp mysql.server /etc/init.d
cd /etc/init.d
mv mysql.server mysqld
cd /usr/bin
ln -s /usr/local/mysql/bin/mysql mysql
centos6.5安装mysql-5.7
最新推荐文章于 2024-11-07 15:10:30 发布