汇总一些mysql常用管理命令:
mysql_install_db is deprecated. Please consider switching to mysqld --initialize
mysql_install_db已被弃用。 请考虑切换到mysqld --initialize
mysqld_safe --defaults-file=/etc/my${mysql_port}.cnf 2>&1 > /dev/null &
service mysqld stop 或 /etc/init.d/mysqld stop
mysqladmin -u root password 'root_test'
1.初始化实例
5.6 mysql_install_db
mysql_install_db --defaults-file=$MySQL_CONF --user=$MySQL_USER --basedir=$MySQL_HOME --datadir=$MySQL_DATA5.7 mysqld
mysqld --initialize-insecure --user=$MySQL_USER --basedir=$MySQL_HOME --datadir=$MySQL_DATAmysql_install_db is deprecated. Please consider switching to mysqld --initialize
mysql_install_db已被弃用。 请考虑切换到mysqld --initialize
2.启动实例
service mysql3307 start 或 /etc/init.d/mysqld startmysqld_safe --defaults-file=/etc/my${mysql_port}.cnf 2>&1 > /dev/null &
mysqld文件来源:
cp $MySQL_HOME/support-files/mysql.server /etc/init.d/mysqld
3.关闭实例
mysqladmin -u root -p shutdownservice mysqld stop 或 /etc/init.d/mysqld stop
参考:
一个比较好的参考
https://www.cnblogs.com/kevingrace/p/6151066.html
mysqladmin -u root password 'root_test'