Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
# cp my-medium.cnf my.cnf
# cp /usr/share/mysql/mysql.server /etc/rc.d/rc.mysql
# /etc/rc.d/rc.mysql start &
# su - mysql
ls -al /var/lib/mysql/
drwxr-x--- 4 mysql mysql 4096 Feb 21 20:51 ./
drwxr-xr-x 16 root root 4096 Jan 24 2002 ../
-rw------- 1 mysql mysql 30 Feb 21 20:34 .bash_history
-rw-rw---- 1 mysql mysql 73 Feb 21 20:32 jack5-bin.001
-rw-rw---- 1 mysql mysql 73 Feb 21 20:34 jack5-bin.002
-rw-rw---- 1 root root 4872 Feb 21 20:51 jack5-bin.003
-rw-rw---- 1 mysql mysql 48 Feb 21 20:51 jack5-bin.index
-rw-r--r-- 1 mysql root 591 Feb 21 20:34 jack5.err
drwx------ 2 root root 4096 Feb 21 20:51 mysql/
drwx------ 2 root root 4096 Feb 21 20:51 test/
$ /usr/bin/mysqladmin -u root -p password 'new-password'
# /etc/rc.d/rc.mysql start
whenever i try to login using root it says permission denied
i tried logging in using bash as well as using php scripts ...but both times i am getting the same error msg
however i am able to edit and create tables/databases using webmin...but what use if i am unable to connect to my db using php
Have a tried creating a new user for your database and giving them the correct permissions on your tables and then logging in as this user instead of root? This is more secure in the long run anyway as you won't have to put the root password into wherever your PHP script is getting its login information from.
You might end up getting the same error message but it's worth a go?
Also, how exactly are you passing the user name and password through to mysql from bash/PHP? Code snippets might help see if something is going wrong there.
mysql_connect("127.0.0.1", "root", "pswd")
or die("Could not connect : " . mysql_error());
echo "Connected successfully";
mysql_select_db("teleDir") or die("Could not select database");
/* Performing SQL query */
$query = "SELECT * FROM Clients";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
when i was using fc this script used to work like a charm...........
how do i create a user granting it all the permissions.....
If you have a GUI like mysqlcc it can make this easier.
Is that PHP script running on the same host as the mySQL database?
If you try put "localhost" in place of "127.0.0.1" do you get the same error? And if you try the username as "root@localhost" instead of just "root"? You might also want to look inside the "user" table in the "mysql" database to see what username and host combinations there are.
i think i have to create a new user granting him all the permissions ...........as i have tried ll possible combinations with this script and this script is a running script.............im going to make a new user and grant ti all the permissions......any other suggestions pl