根据deb-bundle安装MySQL
服务器类型:SMP Debian 4.9.189-3+deb9u2 (2019-11-11) x86_64 GNU/Linux
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-server_8.0.19-1debian9_amd64.deb-bundle.tar
tar zvf mysql-server_8.0.19-1debian9_amd64.deb-bundle.tar
libmysqlclient-dev_8.0.19-1debian9_amd64.deb libmysqlclient21_8.0.19-1debian9_amd64.deb mysql-client_8.0.19-1debian9_amd64.deb mysql-common_8.0.19-1debian9_amd64.deb mysql-community-client-core_8.0.19-1debian9_amd64.deb mysql-community-client_8.0.19-1debian9_amd64.deb mysql-community-server-core_8.0.19-1debian9_amd64.deb mysql-community-server-debug_8.0.19-1debian9_amd64.deb mysql-community-server_8.0.19-1debian9_amd64.deb mysql-community-test-debug_8.0.19-1debian9_amd64.deb mysql-community-test_8.0.19-1debian9_amd64.deb mysql-server_8.0.19-1debian9_amd64.deb mysql-testsuite_8.0.19-1debian9_amd64.deb
|
根据实践,得到以下依赖关系
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| touch /etc/mysql/my.cnf.fallback dpkg -i mysql-common_8.0.19-1debian9_amd64.deb dpkg -i libmysqlclient21_8.0.19-1debian9_amd64.deb dpkg -i libmysqlclient-dev_8.0.19-1debian9_amd64.deb dpkg -i mysql-community-server-core_8.0.19-1debian9_amd64.deb dpkg -i mysql-community-client-core_8.0.19-1debian9_amd64.deb dpkg -i mysql-community-client_8.0.19-1debian9_amd64.deb dpkg -i mysql-client_8.0.19-1debian9_amd64.deb
dpkg -i mysql-community-server_8.0.19-1debian9_amd64.deb
dpkg -i mysql-server_8.0.19-1debian9_amd64.deb
apt --fix-broken install
|
The server requested authentication method unknown to the client
安装好Mysql最新版本8.0.19后 ,用php测试链接时出现了以上问题。
发现是由于新版本的mysql账号密码解锁机制不一致导致的
解决办法来自__MAN的blog:
删除创建的用户和授权,
1
| 找到mysql配置文件并加入default_authentication_plugin=mysql_native_password
|
变为原来的验证方式,然后从新创建用户并授权即可
或
1 2 3 4
| mysql -u root -p use mysql; ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的密码';
|
或者
在CREATE USER时,使用IDENTIFIED WITH xxx_plugin BY ‘password’,比如:
1
| CREATE USER 'native'@'localhost' IDENTIFIED WITH mysql_native_password BY 'yourpassword';
|
授权
Access Denied问题
1 2
| # privileges可以是INSERT,UPDATE,SELECT等等。 GRANT privileges ON databasename.tablename TO 'username'@'host';
|