1.安装依赖(两种安装方式)
a.on Yum-based systems:
yum search libaio # search for info
yum install libaio # install library
b.on APT-based systems:
apt-cache search libaio # search for info
apt-get install libaio1
切换目录:
cd /usr/local
2.解压安装包
tar -zxvf *.gz.tar
ln -s mysql* mysql
cd mysql
bin/mysqld --initialize --user=root
此处记住初始密码
bin/mysql_ssl_rsa_setup
bin/mysqld_safe --user=mysql &
cp support-files/mysql.server /etc/init.d/mysql.server
/etc/init.d/mysql.server start
此时mysql服务已经启动
mysql -u root -p
输入初始密码
如果报错如下错误 则是缺少依赖
mysql: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
安装依赖
apt-get install libncurses5-dev
apt-get install libncurses5
登录成功修改初始密码
alter user ‘root’@’localhost’ identified by ‘123’;
设置允许远程登录(用户名和密码注意更换)
grant all on *.* to '用户名'@'%' identified by ’密码’;
flush privileges