Question

mysql error 1064

Posted April 7, 2021 1.6k views
MySQLLAMP Stack

Hi,

I have just set up my second virtual host and it works. Now I want to install a second Wordpress site following the mysql from this tut:

https://www.digitalocean.com/community/tutorials/how-to-set-up-multiple-wordpress-sites-on-a-single-ubuntu-vps

Since I already have one site up and running on my first virtual host I only want to create a database and user for my second Wordpress site.

CREATE DATABASE SecondDatabase;

OK

CREATE USER SecondUser@localhost;

OK

SET PASSWORD FOR SecondUser@localhost= PASSWORD(“SecondPassword”);

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘IDENTIFIED BY 'SecondPassword’’ at line 1

I have mysql Ver 8.0.23.

Then I tried:

CREATE USER 'SecondUser’@’%’ IDENTIFIED WITH mysqlnativepassword BY 'SecondPassword’;

OK

GRANT ALL ON SecondDatabase.* TO 'SecondUser’@’%’;

OK

Wordpress site is not up and I’m afraid I have messed up my mysql users and databases.

I have changed the wp-config.php so it matches the mysql database, user and password names.

Any help on how to solve this will be greatly appreciated, thanks!

Ben

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hi @artctrldelinfob0d23996f849,

Let’s start from the beginning and create a database and a user. You can use the bellow commands:

mysql

in mysql type in

CREATE DATABASE db_name_here;
CREATE USER 'user-here'@'localhost' IDENTIFIED WITH mysql_native_password BY 'my-strong-password-here';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, INDEX, DROP, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON db_name_here.* TO 'user-here'@'localhost';

In these instructions:

  • replace dbnamehere with the name of your MySQL database
  • replace my-strong-password-here by a strong secure password.
  • replace user-here by your chosen MySQL username.

Now you can try and install your WordPress website. When going through the installation, you can add the database name, database user and the database user’s password. It should work without a problem.

Regards,
KFSys

  • Hi KFSys,

    Thanks for your help!

    I have created the the database, user and password, nice. But it seems I have another problem, I can’t figure what.
    I tried changing the table_prefix and using the same database, user and password and the problem is the same.

    I just get a white page. I know the virtual host is working. So it is the Wordpress installation I can’t set up.

    What can a white page be?

    I have changed the:

    “curl -s https://api.wordpress.org/secret-key/1.1/salt/

    and added the: “define(‘FS_METHOD’, 'direct’);”.

    Created the .htacces with: “touch /tmp/mylocation/.htaccess” which is empty btw.

    I have changed permissions and users.

    I have made the config test and restarted apache.

    www.artctrldel.shop

    Thanks!