mysql坑点

版权声明:柠檬乐园:200145783 https://blog.csdn.net/u014431237/article/details/84840182

安装mysql

5.7 :https://www.cnblogs.com/daemon-/p/9009360.html

8.0:https://blog.csdn.net/u014431237/article/details/81810009

装完启动遇到这个错误 一般是my.cnf问题

ERROR! The server quit without updating PID file (/usr/local/var/mysql/bogon.pid).

百度一堆都没有好的解决方案,报错日志也不同。

故重装。

权限给足 

然后初始化:

./mysqld --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --initialize

my.cnf

[mysql]
default-character-set=utf8
[mysqld]
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
#skip-grant-tables  #这个是忘记密码了 需要重新设置密码 跳过密码验证

 设置新密码:update mysql.user set authentication_string=password('123456') where user='root';

刷新权限:flush privileges;

重启:service mysqld restart


远程链接报错:Host 'xxx' is not allowed to connect to this MySQL server.

>use mysql
>update user set host = '%' where user = 'root';

use mysql错误:mysql error You must reset your password using ALTER USER statement before executing this statement.

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

step 2:  flush privileges;


Mysql运用

存放表情遇到的坑:

 (1):修改mysql数据库的编码为uft8mb4

 (2):修改数据表的编码为utf8mb4

 (3):jdbc:mysql://IP:3306/mixin?useUnicode=true&characterEncoding=utf-8&useSSL=false

猜你喜欢

转载自blog.csdn.net/u014431237/article/details/84840182