1. [MySQL ERROR 1698 (28000) 错误]
一般是安装时候提示没有输入密码,导致登录密码出问题。
1.1.1. 使用root权限登录
sudo mysql -u root -p
1.1.2. 使用安全模式登录
sudo vim sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
mysql -u root -p
mysqld.cnf 配置文件中添加“skip-grant-tables”
[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
1.2. 修改密码
update mysql.user set authentication_string=PASSWORD('atlas1803'), plugin='mysql_native_password' where user='root';
flush privileges;
PASSWORD要使用大写。
1.3. 重启mysql
sudo service mysql restart