Install and Config MySQL 8 on Ubuntu

Posted ToRapture

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Install and Config MySQL 8 on Ubuntu相关的知识,希望对你有一定的参考价值。

Remove Completely and Install

sudo apt-get remove --purge "mysql*"
sudo apt-get purge "mysql*"
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get remove dbconfig-mysql
sudo apt-get dist-upgrade
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get update && sudo apt-get install mysql-server

Enable Remote Access

su root
mysql -uroot -e "     ALTER USER ‘root‘@‘localhost‘ IDENTIFIED WITH caching_sha2_password BY ‘yourpasswd‘;     CREATE USER ‘root‘@‘%‘ IDENTIFIED BY ‘yourpasswd‘;     GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘;     FLUSH PRIVILEGES;"

In /etc/mysql/mysql.conf.d/mysqld.cnf:

  • replace bind-address = 127.0.0.1 with bind-address = 0.0.0.0

Then restart mysql by sudo service mysql restart.

以上是关于Install and Config MySQL 8 on Ubuntu的主要内容,如果未能解决你的问题,请参考以下文章

brew uninstall older mysql and install mariadb

Manual install on Windows 7 with Apache and MySQL

install mysql from source and troubleshooting example

[python] arch linux install mysql and use with python

install mysql in centos and change passoword

pip install mysqlclient 出现 mysql_config: not found 错误