Jump to content

MySQL problems


Recommended Posts

I have installed MySQL and I have created a user and a database. I have granted this new user all priviliges to the new database.

 

Here is how I try to login:

mysql -u kristof -p
**password**
ERROR 1045: Access denied for user: 'kristof@localhost' (Using password: YES)

If I don't use the -p parameter, I don't get the error and I can login. I am positive that I typed the correct password.

What could be wrong?

 

I decided to test MySQL with a small PHP file.

<?php
     $user="kristof";
     $password="***";
     $cnn = mysql_connect("localhost", $user, $password) or die ("Not connected");
?>

When I view that php file in my browser, I get this error:

Fatal error: Call to undefined function: mysql_connect() in /var/www/html/test.php on line 5

 

Do I have to modify my apache config?

Edited by Kristof
Link to comment
Share on other sites

what version of mandrake are you running..

 

why not just use the webadmin page and set it up that way in the mysql database and users list..?

Link to comment
Share on other sites

I'm a linux newbie; I did my first install a few weeks ago. I am using Mandrake 9.2. I had no idea there was something like webmin or webadmin. I just used the CLI, like I did in Windows, using the command prompt.

 

So I need to do urpmi php-mysql. And for the mod_php? Is that also something I need to install, or something I need to modify in a config file?

And what exactly is webmin?

Link to comment
Share on other sites

I installed php-mysql en mod_php and everything is working fine now. I have deleted the user and have created it again and it works now. Thanks for the help!

 

I also gave webmin a try. Looks very nice!

Link to comment
Share on other sites

php-mysql is the php module that contains the mysql functions mysql_query() etc.

mod_php is an apache module that allows your webserver to process .php scripts and serve them.

If you are only using php for command line scripts then mod_php is not needed.

Link to comment
Share on other sites

grab a copy of phpMyAdmin as well. urpmi phpmyadmin should work. that gives you a nice web interface to your mysql install.

 

the MySQL Control Center is useful too -but use with caution. Any data changes are immediately implemented in your MySQL database. You dont get a submit button with MySQL CC - you are actually editing the live data.

Link to comment
Share on other sites

May i ask a question..?

 

What does urpmi ***phpmyadmin***

 

*being the program *

 

what exactly does urpmi actually do and mean.. ?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...