a*******s 发帖数: 324 | 1 hello,
suppose the local hostname="pluto". There are two users(root,someone) with all
the privileges.
To connect to the database, for root.
mysql_real_connect(mysql,"pluto","root","password","database",0,NULL,0)
mysql_real_connect(mysql,"localhost","root","password","database",0,NULL,0)
Both are correct.
For someone(not root)
mysql_real_connect(mysql,"localhost","someone","password","database",0,NULL,0)
it is correct.
mysql_real_connect(mysql,"pluto","someone","password","database",0,NULL,0)
it | o*h 发帖数: 16 | 2 list all records in table user of database mysql, you can know it.
【在 a*******s 的大作中提到】 : hello, : suppose the local hostname="pluto". There are two users(root,someone) with all : the privileges. : To connect to the database, for root. : mysql_real_connect(mysql,"pluto","root","password","database",0,NULL,0) : mysql_real_connect(mysql,"localhost","root","password","database",0,NULL,0) : Both are correct. : For someone(not root) : mysql_real_connect(mysql,"localhost","someone","password","database",0,NULL,0) : it is correct.
|
|