当前位置:Gxlcms > 数据库问题 > Install and Config MySQL 8 on Ubuntu

Install and Config MySQL 8 on Ubuntu

时间:2021-07-01 10:21:17 帮助过:26人阅读

Remove Completely and Install

  1. <code class="language-bash">sudo apt-get remove --purge "mysql*"
  2. sudo apt-get purge "mysql*"
  3. sudo apt-get autoremove
  4. sudo apt-get autoclean
  5. sudo apt-get remove dbconfig-mysql
  6. sudo apt-get dist-upgrade
  7. sudo rm -rf /etc/mysql /var/lib/mysql
  8. sudo apt-get update && sudo apt-get install mysql-server
  9. </code>

Enable Remote Access

  1. <code class="language-bash">su root
  2. 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;"
  3. </code>

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

标签:ble   word   ddr   flush   caching   with   serve   mysqld   complete   

人气教程排行