LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   attempting to setup lamp server (http://www.linuxquestions.org/questions/linux-newbie-8/attempting-to-setup-lamp-server-879251/)

tanasqui 05-06-2011 03:21 PM

attempting to setup lamp server
 
Error: Cannot connect to the database because: INSERT command denied to user 'webuser'@'localhost' for table 'visitor'

mysql> select Host, User, Password, Select_priv, Insert_priv, Update_priv from user where User='webuser';
+-----------+---------+----------+-------------+-------------+-------------+
| Host | User | Password | Select_priv | Insert_priv | Update_priv |
+-----------+---------+----------+-------------+-------------+-------------+
| localhost | webuser | | Y | Y | Y |
+-----------+---------+----------+-------------+-------------+-------------+
1 row in set (0.00 sec)

<?php
$host="localhost"; // Host name
$username="webuser"; // Mysql username
$password=""; // Mysql password
$db_name="_main"; // Database name
$tbl_name="page"; // Table name

// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
?>

yancek 05-06-2011 03:46 PM

Which Linux distribution are you using?
Is this a new install?
New install of LAMP?
Did you restart mysqld after granting privileges?
Did you check permissions on the /var/lib/mysql directory and sub-directories?

acid_kewpie 05-06-2011 03:47 PM

You're not even going to give us any context whatsover, just paste a bunch of terminal output? No hello, no please, no thank you?

http://dev.mysql.com/doc/

tanasqui 05-06-2011 03:54 PM

I apologize, This server is running on Ubuntu 10.10 server, new install of lamp. Restarted after privileges, permissions were not checked, what should they be?


All times are GMT -5. The time now is 12:42 PM.