Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Following guide for WordPress, stuck on SQL

Hi, I'm having a problem with this guide I found online.

https://ubuntu.com/tutorials/install-and-configure-wordpress#4-configure-database

 

When I type.

mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER
    -> ON wordpress.*
    -> TO wordpress@localhost
    -> IDENTIFIED BY '<your-password>';

I get.

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 '-> ON wordpress.*
    -> TO wordpress@localhost
    -> IDENTIFIED BY '<your-pass' at line 2


The guide doesn't explain which password to use, or what these commands do.

I tries putting the commands in as-is, and various different passwords but I get the same error, the guide said not to bother wit an sql password so I didn't set that.

Any advice would be greatly appreciated.

 

Thanks

Link to post
Share on other sites
8 minutes ago, Dangerous Thinking said:

mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER
    -> ON wordpress.*
    -> TO wordpress@localhost
    -> IDENTIFIED BY '<your-password>';


 
8 minutes ago, Dangerous Thinking said:

The guide doesn't explain which password to use, or what these commands do.

I tries putting the commands in as-is, and various different passwords but I get the same error, the guide said not to bother wit an sql password so I didn't set that.

Did the guide instruct you to make a MySQL account, using a "CREATE USER" statement? Did you include the "mysql>" and "->" in the command (if so, remove those).

Basically, what the command above does, is give a user (wordpress@localhost) permission to do certain action within the database (that's the SELECT, INSERT, etc.).

 

If possible, could you link me the guide (and if there are multiple steps, please tell where you are in the steps currently), maybe I can check some things to give the code above some more context for myself.

"We're all in this together, might as well be friends" Tom, Toonami.

Sorry if my post seemed rude, that is never my intention.

"Why do we suffer a lifetime for a moment of happiness?" - Anonymous

Link to post
Share on other sites

I'm at this step currently  https://ubuntu.com/tutorials/install-and-configure-wordpress#4-configure-database

 

Yeah, I put the -> in, oops.

I'll try the command without it.

The guide didn't tell me to create a user or set a password.

 

Tried the edited command.

 

GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER
ON wordpress.*
TO wordpress@localhost
IDENTIFIED BY '<your-password>';

 

now I get.

 

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 '<your-password>'' at line 4

What password does it want, what should I put if I haven't set one?

 

Link to post
Share on other sites
10 minutes ago, Dangerous Thinking said:

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 '<your-password>'' at line 4

What password does it want, what should I put if I haven't set one?

Try this:

IDENTIFIED BY 'root';

 

"We're all in this together, might as well be friends" Tom, Toonami.

Sorry if my post seemed rude, that is never my intention.

"Why do we suffer a lifetime for a moment of happiness?" - Anonymous

Link to post
Share on other sites

Nah, same problem.

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 'root'' at line 4

 

The good news is Apache is working, I can get to the default page.

Link to post
Share on other sites
1 hour ago, minibois said:

Did the guide instruct you to make a MySQL account, using a "CREATE USER" statement? Did you include the "mysql>" and "->" in the command (if so, remove those).

Basically, what the command above does, is give a user (wordpress@localhost) permission to do certain action within the database (that's the SELECT, INSERT, etc.).

 

If possible, could you link me the guide (and if there are multiple steps, please tell where you are in the steps currently), maybe I can check some things to give the code above some more context for myself.

I'm thinking of starting again, following a different guide, most of them use MariaDB.

Do you think it will cause any conflicts with mySQL, Should I uninstall it?

Link to post
Share on other sites

The sql statement you are trying to use is creating a new user and applying its privileges in one statement. After version 8 of mysql/mariab you can no longer do this.

 

You first have to create the user

CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'your password here';

Then apply its privileges

GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER ON wordpress.* TO 'wordpress'@'localhost';

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×