vestacp with mysql 8 under ubuntu 18.04
Posted: Wed Sep 18, 2019 3:16 pm
If you plan on updating mysql to version 8 you must change in vesta config:
1. cd /usr/local/vesta/bin
2. nano v-add-database
3. Search for line
4. Add after:
these lines:
In our tests we had to change the next 2 query lines and make them look like these:
This change should not be a problem.
Very important, mysql must be configured tu authenticate using "mysql_native_password", so in mysql configuration file (/etc/mysql/my.cnf ) under [mysqld] add:
default_authentication_plugin = mysql_native_password
Adding, suspending and deleting database and user works fine. No more changes needed.
1. cd /usr/local/vesta/bin
2. nano v-add-database
3. Search for line
Code: Select all
# Create MySQL database
Code: Select all
query="CREATE DATABASE \`$database\` CHARACTER SET $charset"
mysql_query "$query" > /dev/null
Code: Select all
query="CREATE USER \`$dbuser\`@\`$host\` IDENTIFIED BY '$dbpass'"
mysql_query "$query" > /dev/null
query="ALTER USER \`$dbuser\`@\`$host\` IDENTIFIED WITH mysql_native_password BY '$dbpass'"
mysql_query "$query" > /dev/null
Code: Select all
query="GRANT ALL ON \`$database\`.* TO \`$dbuser\`@\`%\`"
mysql_query "$query" > /dev/null
query="GRANT ALL ON \`$database\`.* TO \`$dbuser\`@localhost"
mysql_query "$query" > /dev/null
Very important, mysql must be configured tu authenticate using "mysql_native_password", so in mysql configuration file (/etc/mysql/my.cnf ) under [mysqld] add:
default_authentication_plugin = mysql_native_password
Code: Select all
[mysqld]
default_authentication_plugin = mysql_native_password