XILO Community Forum

Support 0345 468 0005 • Sales 0800 848 8468 • sales chat

Go Back   XILO Community Forum > Customer Support > Support Queries > Databse problem
Support Queries This forum should be used to contact our support team should you have any problems with your account.

Closed Thread
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
Hi
Ovie is on a distinguished road
 
Posts: 8
Join Date: Sep 2006
Location: Cambridge
Default Databse problem - 05/09/2006, 11:45 AM

On one of my accounts, fovi.co.uk (in the reseller package), I've created a
new MySQL database, and I've added a user. However, when I add the user
privelleges I get this error:

Connection Strings
Perl $dbh = DBI->connect("DBI:mysql:fovi_cms:localhost","fovi_1"," ");
PHP $dbh=mysql_connect ("localhost", "fovi_1", "") or die ('I cannot connect
to the database because: ' . mysql_error());
mysql_select_db ("fovi_cms");

And in phpMyAdmin, it won't let me create tables or run SQL queries or
anything.

What's the problem?

Thanks,

Ovie
</td></tr></tbody></table>
  (#2 (permalink)) Old
Techie & Moderator
Kieran is on a distinguished road
 
Kieran's Avatar
 
Posts: 764
Join Date: Apr 2006
Location: Swindon, UK
Default Re: Databse problem - 05/09/2006, 11:57 AM

That isn't an error; that is simply providing you with the connection strings in perl and php required to connect to and use your database. The appearance of those strings actually means that your database and the user permissions for it are setup correctly.

As for what you cannot do in phpmyadmin, I assume you have checked the phpMyAdmin docs to check you are attempting to add tables the correct way?
  (#3 (permalink)) Old
Hi
Ovie is on a distinguished road
 
Posts: 8
Join Date: Sep 2006
Location: Cambridge
Default Re: Databse problem - 05/09/2006, 1:03 PM

Quote:
Originally Posted by Kieran View Post
That isn't an error; that is simply providing you with the connection strings in perl and php required to connect to and use your database. The appearance of those strings actually means that your database and the user permissions for it are setup correctly.

As for what you cannot do in phpmyadmin, I assume you have checked the phpMyAdmin docs to check you are attempting to add tables the correct way?
Ahh sorry, stupid me, I'm new to this sql stuff.

I'm following a CMS tutorial, and I need to add this:

Code:
CREATE TABLE `databasename`.`cmsarticles`   (
  `ID` int(6) unsigned NOT NULL auto_increment COMMENT 'The   unique ID of the article',
  `title` varchar(200) NULL COMMENT 'The article   title',
  `tagline` varchar(255) NULL COMMENT 'Short   summary of the article',
  `section` int(4) NULL DEFAULT 0 COMMENT 'The   section of the article',
  `thearticle` text NULL COMMENT 'The article   itself',
  PRIMARY KEY (`ID`)
  ); 



How would I use that code?
  (#4 (permalink)) Old
User
A-Wing is on a distinguished road
 
A-Wing's Avatar
 
Posts: 23
Join Date: Aug 2006
Location: N. Wales
Send a message via MSN to A-Wing Send a message via Skype™ to A-Wing
Default Re: Databse problem - 05/09/2006, 1:05 PM

According to the above the user "fovi_1" doesn't have a password. I wouldn't be surprised if phpMyAdmin doesn't like this situation and its not a good idea from a security point of view anyway.
The phpMyAdmin problem sounds like some strange privilages problem. You could be trying to create tables in a database your user doesn't have access to.
  (#5 (permalink)) Old
User
A-Wing is on a distinguished road
 
A-Wing's Avatar
 
Posts: 23
Join Date: Aug 2006
Location: N. Wales
Send a message via MSN to A-Wing Send a message via Skype™ to A-Wing
Default Re: Databse problem - 05/09/2006, 1:06 PM

Quote:
Originally Posted by Ovie View Post
How would I use that code?
Click on the SQL tab on phpMyAdmin and paste it in. Hit 'Go' or whatever it is and it should do it.
  (#6 (permalink)) Old
Tom Tom is offline
XILO Staff


Tom is on a distinguished road
 
Tom's Avatar
 
Posts: 171
Join Date: Nov 2005
Default Re: Databse problem - 05/09/2006, 1:09 PM

Quote:
Originally Posted by A-Wing View Post
According to the above the user "fovi_1" doesn't have a password. I wouldn't be surprised if phpMyAdmin doesn't like this situation and its not a good idea from a security point of view anyway.
The phpMyAdmin problem sounds like some strange privilages problem. You could be trying to create tables in a database your user doesn't have access to.
Have you assigned "ALL" permissions for that user again the database?

This can be done (or has to be done) via cPanel.

Tom


XILO Communications Ltd.
Internet Hosting and Online Services
w: http://www.xilo.net/
h: http://my.xilo.net/
t: +44 (0) 845 034 6444
f: +44 (0) 845 034 6555
  (#7 (permalink)) Old
Hi
Ovie is on a distinguished road
 
Posts: 8
Join Date: Sep 2006
Location: Cambridge
Default Re: Databse problem - 05/09/2006, 1:19 PM

I've assigned all permissions, I've also set passwords, and I've tried it numerous times...deleting recreating accounts and databases etc.

In phpmyadmin it says that I don't have the permission, but I did assign "all" for the user I created. And when I try to sign out in phpmyadmin, it says "user name and password invalid".
  (#8 (permalink)) Old
Techie & Moderator
Kieran is on a distinguished road
 
Kieran's Avatar
 
Posts: 764
Join Date: Apr 2006
Location: Swindon, UK
Default Re: Databse problem - 05/09/2006, 1:47 PM

That message when you sign out is normal as authentication for phpMyAdmin is provided by CPanel, as is signing out.

My best advice to you is to delete the user and the database in CPanel, clear your browser cache, and then start over doing the following:-

1. Setup a database in cpanel
2. Setup a username that is different to the database name and with a password.
3. Assign that user to the database with "ALL" permissions
4. Make sure the database name and username are different to before.
5. Using phpMyAdmin select the database you have just created using the link/drop-down menu on the left.
6. Run queries on the SQL tab that appears in the right pane on the top.

That *should* all work. If it still doesn't post here again

Things you might also check:-
- Has the whole cpanel account (created by your reseller username) got MySQL access and phpMyAdmin access? Check the feature lists.
- Have you got any other CPanel sessions running
  (#9 (permalink)) Old
Hi
Ovie is on a distinguished road
 
Posts: 8
Join Date: Sep 2006
Location: Cambridge
Default Re: Databse problem - 05/09/2006, 4:12 PM

Quote:
MySQL said: Documentation
#1142 - CREATE command denied to user 'fovi'@'localhost' for table 'cmsarticles'
Still no luck...
  (#10 (permalink)) Old
Techie & Moderator
Kieran is on a distinguished road
 
Kieran's Avatar
 
Posts: 764
Join Date: Apr 2006
Location: Swindon, UK
Default Re: Databse problem - 06/09/2006, 1:09 AM

Right, I've got it. That was no snitch of an error to track down I tell you

I've recreated it and its your SQL that is wrong.

To create the table you want to create you need to use the SQL tab as you have been doing, but use the following code:

Code:
CREATE TABLE `cmsarticles` ( `ID` int(6) unsigned NOT 
NULL auto_increment COMMENT 'The unique ID of the 
article', `title` varchar(200) NULL COMMENT 'The article 
title', `tagline` varchar(255) NULL COMMENT 'Short 
summary of the article', `section` int(4) NULL DEFAULT 0 
COMMENT 'The section of the article', `thearticle` text NULL 
COMMENT 'The article itself', PRIMARY KEY (`ID`) );
The 'databasename' bit was causing you the problem because phpMyAdmin has already selected the database onto which your queries are actioned and you were specifying a non-existant database on which to execute the query while already logged into another one hence the permissions error.

When you use phpMyAdmin to run queries you should only specify table names, never database names in your SQL.

Hope this helps
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes



Powered by vBulletin | XHTML | © Copyright 2003-2009 XILO Communications Ltd. All rights reserved. E&OE