Linux系统下mysql 5.7.31 glic版本安装一些问题整理

1.mysqld_safe error: log-error set to '/var/log/mariadb/mariadb.log

cd /var/log/

mkdir mariadb

cd mariadb/

touch mariadb.log

2.终端输入mysql -u root -p出现错误:-bash: mysql: command not found

alias mysql=/usr/local/mysql/bin/mysql

在系统变量路径加入mysql

export PATH=$PATH:$JAVA_HOME/bin:/usr/local/mysql/bin:$PATH

3.Can't connect to local MySQL server through socket '/tmp/mysql.sock'

ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

 

创建目录别忘记chown -R mysql:mysql  修改当前目录拥有者为 mysql 用户

 

权限

grant all privileges on *.* to root@"%" identified by "密码";

 flush privileges;

重启mysql

 

 

 

©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页