# /usr/local/mysql/bin/mysqld --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql --initialize-insecure
注意:可能会有报错信息,如下:
/usr/local/mysql/bin/mysqld: error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory
如果安装mysql出现了以上的报错信息.这是缺少numactl;
执行:yum -y install numactl就可以解决这个问题了.
然后,重新执行初始化:
# /usr/local/mysql/bin/mysqld --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql --initialize-insecure
启动服务:
# /usr/local/mysql/support-files/mysql.server start
Starting MySQL.. SUCCESS!==========================================================================================================================================
MySQL service options:
Usage: mysql.server {start|stop|restart|reload|force-reload|status}[ MySQL server options ]
5. 安装初始化(并非必须执行)
# /usr/local/mysql/bin/mysql_secure_installation
首先是设置密码,会提示先输入密码
Press y|Y for Yes, any other key for No: 初次运行直接回车
设置密码:
Set root password? 是否设置root密码
New password: 设置root密码
Re-enter new password: 在输入一次密码
其他配置:
Remove anonymous users?(Press y|Y for Yes, any other key for No): 是否删除匿名用户
Disallow root login remotely?(Press y|Y for Yes, any other key for No): 是否禁止root远程登录
Remove test database and access to it?(Press y|Y for Yes, any other key for No): 是否删除test database
Reload privilege tables now?(Press y|Y for Yes, any other key for No): 是否重新加载授权表
以上是执行安全初始化之后输出的信息,根据自身需求进行配置即可