mysql 启动命令: 调试使用
mysqld &
mysqld_safe &
msyqld_safe --defualts-file=/tmp/mysql.cnf &
/etc/init.d/mysqld start
systemctl start mysqld
忘记r本地管理员密码, 修改密码
1. 停止数据库
systemctl stop mysqld
2. 重启启动数据库
mysqld_safe --skip-grant-tables --skip-networking &
3. 登录数据库
mysql
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
mysql> alter user root@'localhost' identified by '123';
Query OK, 0 rows affected (0.00 sec)
mysql> shutdown;
Query OK, 0 rows affected (0.00 sec)
4.重启数据库生效
[root@db01/data/mysql/data]#/etc/init.d/mysqld start
网友评论