简体   繁体   中英

Can't connect to database using my recently added user in MySQL

I'm trying to add a new user to a mysql database. The original state of the file looks like this (which works):

$dconex=mysql_connect("200.xxx.xxx.xxx","abong1","XXXXXX");
mysql_select_db("abong1",$dconex);

I'm trying to add this line in between the mysql_select_db:

$dconex=mysql_connect("200.xxx.xxx.xxx","abong1_abongler","XXXXXXXX");

I configured the user in PhpMyAdmin with the correct IP, username, and password, but it doesn't seem to work. Is it something about the username? should it have a 'root' like "abong1.abong1_abongler" ?

Thanks in advance.

您可能需要运行

flush privileges;

What error are you getting, specifically? Permission denied? Can't connect? Change your connection line to the following:

$dconex=mysql_connect("200.xxx.xxx.xxx","abong1_abongler","XXXXXXXX") or die(mysql_error());

and see what error gets spit out. If it's permission denied, then your user isn't configured properly (could be username, hostname, or password is incorrect). Connection refused would be MySQL not allow connections over TCP.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM