Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Database Server
  • Search

vestacp with mysql 8 under ubuntu 18.04

Questions regarding the Database Server
MySQL, PostgreSQL, MariaDB, Percona Server, phpMyAdmin, phpPgAdmin
Post Reply
  • Print view
Advanced search
2 posts • Page 1 of 1
fasttrackhost
Posts: 15
Joined: Tue Feb 05, 2019 7:10 pm

Os: Ubuntu 17x
Web: apache
vestacp with mysql 8 under ubuntu 18.04
  • Quote

Post by fasttrackhost » 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

Code: Select all

# Create MySQL database
4. Add after:

Code: Select all

    query="CREATE DATABASE \`$database\` CHARACTER SET $charset"
    mysql_query "$query" > /dev/null
these lines:

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
In our tests we had to change the next 2 query lines and make them look like these:

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
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

Code: Select all

[mysqld]
default_authentication_plugin = mysql_native_password
Adding, suspending and deleting database and user works fine. No more changes needed.
Top

andrewc2
Posts: 2
Joined: Mon Jan 07, 2019 3:20 pm

Os: Ubuntu 17x
Web: nginx + php-fpm
Re: vestacp with mysql 8 under ubuntu 18.04
  • Quote

Post by andrewc2 » Mon May 23, 2022 1:20 am

For an existing install other than backing everything up first, would you update mysql first then make these changes?
Top


Post Reply
  • Print view

2 posts • Page 1 of 1

Return to “Database Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

cron

Login  •  Register

I forgot my password