By Anonymous (not verified) on
I got the database created with the "create database [database_name]", but the user, password and permissions doesn't stick; this is where I get it wrong.
Using cPanel, here's the process I follow:
1.) log into cPanel using my hosting account username & password
2.) click MySQL
3.) create database
3.) create user
4.) add user to database with "all" permissions
I'm trying to do the same thing on the command line with PuTTY (a great telenet/ssh client). I'm 80% there.
I just need to figure out the commands to 3 & 4 (from the list above).
I sure appreciate the help...
Comments
Use the GRANT statement, flush privileges;
I'm assuming you were referring to the second 3, creating the user. Your original post actually has the information you need:
The SQL statement to create a user in MySQL, replace databasename with the name of the database you created. Replace userid with the name of the user you wish to create. Replace password with the password for the user. By issuing the GRANT you are creating the user and giving that user the specified permissions on the database specified. These are the only permissions a Drupal userid should need.
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX,
ALTER, CREATE TEMPORARY TABLES, LOCK TABLES
ON databasename.*
TO 'userid'@'localhost'
IDENTIFIED BY 'password';
Then execute this statement to tell MySQL to reload the GRANT tables:
FLUSH PRIVILEGES;
If you still cannot login with the userid/password you may need to reset the password:
SET PASSWORD FOR 'userid'@'localhost' = OLD_PASSWORD('password');
Regards,
Joel
Still not working....
Thanks Joel, Others, for the assistance.
Still not working.... Here's the commands I used:
Where 'databasename' is the database I created previously, 'userid' is the user I want to create, and 'password' is the password I want to associate with the 'userid'.
Here's the error:
I checked cPanel > MySQL to see if the user was created and it wasn't.
===
Doug Ouverson
hear | see | say | do | teach
Wrong user ID syntax
If you actually typed in: 'userid@localhost' then that's not the correct syntax. It should be: 'userid'@'localhost'. The @ should not be inside the single-quotes.
That was it...
Thanks.
===
Doug Ouverson
hear | see | say | do | teach
Creating user in mysql
I can not create new user in database name 'my_database' .
I tried both queries as shown below:
create user 'myuser'@'localhost' identified by 'mypassword';
create user 'myuser'@'my_database' identified by 'mypassword';
I got an error 1396 HY000
Both of them did not work.
Can any body configure it out.
Thanks .
Here's what I use
Of course, the caps aren't required.
Hope that helps.
I've also posted a "10 minute install using PuTTY" Do a search for "10 minute install" and you should find it.
===
Doug Ouverson
hear | see | say | do | teach
Creating user in mysql
Hi Douge,
I tried your query. It worked.
It shows Query Ok, zero rows effected.
But, when I connect to my own database. It did not ask to me enter username and password for login.
I really appreciate.
Thanks.
"Connect to my own database"?
What do you mean, "connect to my own database"? Is this an original drupal install?
===
Doug Ouverson
hear | see | say | do | teach