Mysql database creation doubt

Status
Not open for further replies.

jasoothai

Active Member
171
2011
10
0
When creating mysql database user, I think following command is used :
Code:
CREATE USER 'webdb_user'@'[B][COLOR=Red]10.0.15.25[/COLOR][/B]' IDENTIFIED BY 'password123';

What I have to put the highlighted part, "localhost" or my vps ip address ?
Thank you for the help...
 
4 comments
localhost will work if you have not changed it, and here is a complete command to add user with privileges on some database.

PHP:
GRANT ALL PRIVILEGES 
       ON DATABASENAME.* 
       TO 'YOURUSER'@'localhost'
       IDENTIFIED BY 'YOURPASSWORD' 
       WITH GRANT OPTION;
// DATABASE = your database name
//YOURUSER = your username for mysql
// YOURPASSWORD = your password for mysql user

More info here
 
That page says :
if you're going to access this database from another computer system, you'll need to specify the IP address of that remote system here instead of "localhost".
What is the ip address of remote system, Is it the IP address of VPS ?
 
if you are going to use mysql from another server/IP then you need to provide your location IP where script is hosted but if script is hosted on same server where mysql database is then you will only use localhost.
 
Last edited:
Status
Not open for further replies.
Back
Top