一.MySQL(Linux)解决登陆权限问题
Ubuntu18.04 安装mysql或者mariadb之后,发现普通用户和远程都没有权限连接。
ERROR 1045: Access denied for user: 'root@localhost' (Using
password: YES)
修改了密码也不对。然后sudo mysql -u root
即可登录。这显然不是我们想要的。
解决方案
删除root,重新创建用户。
首先,登录
sudo mysql -u root
然后查看当前用户
SELECT User,Host FROM mysql.user;
+------------------+-----------+
| User | Host |
+------------------+-----------+
| admin | localhost |
| debian-sys-maint | localhost |
| magento_user | localhost |
| mysql.sys | localhost |
| root | localhost |
删除root账号
mysql> DROP USER 'root'@'localhost';
Query OK, 0 rows affected (0,00 sec)
重新创建root:
mysql> CREATE USER 'root'@'%' IDENTIFIED BY '123456';
Query OK, 0 rows affected (0,00 sec)
授权
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
Query OK, 0 rows affected (0,00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0,01 sec)
https://www.cnblogs.com/woshimrf/p/ubuntu-install-mysql.html
二.Navicat for mysql 中文乱码
1、首先更改LANG改成中文的utf-8
export LANG="zh_CN.UTF-8"
2、选择合适的字体