August 7th, 2000, 07:34 AM
I installed mysql successfully, but when i exec mysql_connect(),
" MySQL Connection Failed: Host 'mail.cug.edu.cn' is not allowed to connect to this MySQL server in .."
August 7th, 2000, 08:07 AM
You need to set your permission tables. Check the manual at http://www.mysql.org/ or the DevShed MySQL forum.
August 10th, 2000, 07:54 AM
Scollo,but it's a pity i am a mysql new man. Can u tell me how to set the permission table?
August 10th, 2000, 03:05 PM
mySQL stores the permission table in a database called mysql. when you first install it, you should be able to get in without any password. do that, and type 'use mysql' to choose the database.
you can then see the tables and manipulate those to give or deny access.
August 10th, 2000, 05:04 PM
even if you are a total newbie you'll still need to understand the permissions to your DB, if you start fiddling with your permissions and mess them up, you could conceiveably leave your DB open to the world
(by default this in NOT the case)
However, MySQL > version 3.22.x does have a nice feature called GRANT which does make the changes to the permission easier
so, from the command line open up the mysql client.
With the default install, you should be able to get in by:
mysql -u root
mysql>GRANT select, insert, update, create, alter, delete, drop
now the user 'user' coming from 'localhost' with the password 'password' can do pretty much anything to your database
personally I would not give this user
create, alter, drop privs, as they would be things that I would do from the command line, not a php script (in 99% of cirumstances)