ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
So its failing to connect to the server rather than failing to authenticate the user yeah?
Run a script that just contains <?PHP phpinfo() ?> and check for any clearly wrong settings in the mysql section. Also, at the risk of insulting you - you sure that the server is running! When you do a
Code:
ps -ef | grep mysql
you see the server running? And can you connect to if from the command line.
If mysql is running on the same box as Apache then you will want to set a value for mysql.default_socket. By default the mysql sock is /tmp/mysql.sock but you'll want to check that. If you got access to the server on the command line then it must be working.
If the mysql server is running on a different box then you will probably want to set values for mysql.default_host and mysql.default_port although these can be specified when you make the connection.
Remember to restart Apache when you make changes to you php.ini file.
I have no entries where it asks for default hosts, port etc etc... what should i put there, it says it will use Mysql default values if none are specified.
Im gonna do the install process again... b 4 I give up, hopefully it will work! I'll keep ya posted.
your problem could be caused by your php config, or it could be as simple as the code is wrong.. are you using the php functions for mysql correctly, like passing in the correct username and password, and selecting the correct db... if you post a bit of the code ill take a look...
Is sounds like the user who mysqld is running as doesn't have permissions to access the directorys/files that hold the database(s). Check your file permissions... you'll probably need to chmod and chown them.
Also when you added that use did you check that it worked on the command line using 'mysql -u username -p'
You use the grant command... IIRC something like (assuming you want to grant them the ability to do anything on any table in a database called 'myDB', and you are currently a user who can edit other users, such as root)
Code:
GRANT ALL PRIVILEGES ON myDB.* TO ric@localhost IDENTIFIED BY
'england' WITH GRANT OPTION;
This would allow user ric to connect from only localhost though! If you wanted them to be able to connection from any machine in myDomain.net then you would also use
Code:
GRANT ALL PRIVILEGES ON myDB.* TO ric@"%.myDomain.net" IDENTIFIED BY
'england' WITH GRANT OPTION;
I've found that the privileges section in the mysql manual to not be that great when you want to set permissions on specific rows etc. So good luck if you need to do this!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.