mysql linux 填坑笔记

开放navicat登录mysql数据库权限

1)

GRANT ALL PRIVILEGES ON *.* TO 'root' @'%' IDENTIFIED BY '123456' WITH GRANT OPTION;

GRANT ALL PRIVILEGES ON *.* TO 'mchz' @'%' IDENTIFIED BY 'mchz' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'admin' @'%' IDENTIFIED BY '123456' WITH GRANT OPTION;

FLUSH   PRIVILEGES;

或2)

UPDATE mysql.user SET Password=PASSWORD('123456') where USER='root';

update user set host = 'localhost' where user = 'mchz' and host='%2' ;
update user set host = '%' where user = 'root' ;

------------------------------------------------------------------------------------------------------------------------------

忘记root密码

关键语句 skip-grant-tables

参见https://www.jb51.net/article/100925.htm

这招很强👍

--------------------------------------------------------------------------------------------------------------------------------

mysql启动失败, 报错,

重启mysql, 建立软连接文件

解决Can 't connect to local MySQL server through socket '/tmp/mysql.sock '
ln /var/lib/mysql/mysql.sock /tmp/mysql.sock

---------------------------------------------------------------------------------------------------------------------------------

linux mysql 操作命令

登录
mysql -u mchz -p
use mysql;

select host, user,password from user;

 

mysql status ,如报lock ,需要去log里面删除lock文件

 mysql 配置文件路径./etc/my.cnf

 

 

posted @ 2018-07-02 19:01  龙鸿轩  阅读(153)  评论(0编辑  收藏  举报