silvernetuk

Well-Known Member
Sep 2, 2002
311
0
166
United Kingdom
Hi,

We are currently have problems with out CPanel License Expired, due to an Base IP Change however this has not been updated yet :(

Any how, how do I make a database from ssh at the mysql for a client ? so when cpanel comes back online there be no problems with the database.

So how do I make it in SSH ?

Regards,
Garry
 

dgbaker

Well-Known Member
PartnerNOC
Sep 20, 2002
2,576
9
343
Toronto, Ontario Canada
cPanel Access Level
DataCenter Provider
From an SSH prompt do the following;

#mysql -pPASSWORD FOR MYSQL
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 387 to server version: 3.23.54

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql& CREATE DATABASE user_databasename;

You should get
Query OK, 1 row affected (0.00 sec)

mysql& SHOW DATABASES;

This will show you the databases installed.

Hope that helps.
 

dgbaker

Well-Known Member
PartnerNOC
Sep 20, 2002
2,576
9
343
Toronto, Ontario Canada
cPanel Access Level
DataCenter Provider
If the user does not exist do the following from the mysql prompt;

mysql& use mysql;
mysql& INSERT INTO user (Host,User,Password)
-& VALUES('localhost','username',PASSWORD('thepassword'));
mysql& FLUSH PRIVILEGES;

To add them to the database you created;

mysql& GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
-& ON username.database
-& TO [email protected]
-& IDENTIFIED BY 'thepassword';
 

silvernetuk

Well-Known Member
Sep 2, 2002
311
0
166
United Kingdom
HI,

I am lost now.

The clients has an account setup on the server already and has one database, but want another one and as CPanel is offline at the min. I need to make the account in SSH.

I get the first bit
mysql& CREATE DATABASE user_databasename;

But when using a database with a forum or something it need a username and password how do I make these ?

Regards,
Garry
 

dgbaker

Well-Known Member
PartnerNOC
Sep 20, 2002
2,576
9
343
Toronto, Ontario Canada
cPanel Access Level
DataCenter Provider
That's this part

To add them to the database you created;

mysql& GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
-& ON username.database
-& TO [email protected]
-& IDENTIFIED BY 'thepassword';

This will allow the user to connect with their id. You will have to either create a password for him or ask him which one to use.
 

silvernetuk

Well-Known Member
Sep 2, 2002
311
0
166
United Kingdom
Hi,

That great, I have worked it out now :)

I am hoping CPanel going to be working soon as the License is still on the old IP :(

Regards,
Garry