News:

LVCS.NET offers low cost domain registration services.

Main Menu

Database Problems

Started by sasurfers, August 30, 2006, 01:46:08 AM

Previous topic - Next topic

sasurfers

Hi Ive been having a few troubles with my databases lately.
Ive been trying to make a survey on my website and it uses MySQL but when I go to create the tables using this script

-- # $Id: mysql_create.sql,v 1.1 2003/02/27 19:04:51 jimmerman Exp $
-- #

-- # Create a database called 'phpesp'.
CREATE DATABASE phpesp;

-- # Switch to the mysql database.
USE mysql;

-- # Create a user called 'phpesp', with a password 'phpesp'. The
-- # 'localhost' limits this user to connecting to the database only via
-- # localhost. You may change the password by changing the
-- # PASSWORD('...') clause.
INSERT INTO user (host, user, password) VALUES ( 'localhost',
  'phpesp', PASSWORD('phpesp'));

-- # Grant the 'phpesp' user (from 'localhost') privileges to select,
-- # insert, update, and delete on the database 'phpesp'.
INSERT INTO db (host, db, user, select_priv, insert_priv,
  update_priv, delete_priv) VALUES ( 'localhost', 'phpesp',
  'phpesp', 'Y', 'Y', 'Y', 'Y');

-- # Tell mysql to re-read the privileges tables so the previous two
-- # operations take effect.
FLUSH PRIVILEGES;


It comes back with this error:

QuoteMySQL said: Documentation
#1044 - Access denied for user 'Samm'@'%' to database 'phpesp'

Am I doing something really stupid that I cant see?

Also, On my plesk account when I go into DB Web Admin it says this:
QuoteCreate new database       Create new database: Documentation
No Privileges
Whattt theee??
Thanks,
Sam

Evilsprouts

You can't use a script to create new databases you have to do it via the options panel, I'm not sure if this is the case with plesk but I think it is.

admin

That is correct, you will need to create the database via the Plesk interface.

You cannot create databases via phpMyAdmin or your own scripts.  Clicking "DB WebAdmin" in Plesk loads phpMyAdmin.

Login to Plesk
Click your domain name
Click "Databases" under the "Services" section
Click "Add New Database"
Enter the name for the database and click "OK"
Click "Add New Database User"
Enter the username/password information and click "OK"

Thank you,
FreePgs.com Admin