+ Reply to Thread
Results 1 to 4 of 4

Thread: MySQL Table Creation Error

  1. #1
    v1air80 is offline x10Hosting Member v1air80 is an unknown quantity at this point
    Join Date
    Jul 2010
    Posts
    4

    Exclamation MySQL Table Creation Error

    Hi.

    I'm getting this error message while trying to create a table in one of my databases.

    Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'website'@'69.175.6.94' (using password: YES) in /home/oneair/public_html/airline_details.php on line 3
    Your have failed to connect


    Now, I am 110% sure the username and password are correct and present. And the users are assigned to the correct database and have the correct privileges.

    Has anyone got any ideas?

    Thanks.

  2. #2
    leafypiggy's Avatar
    leafypiggy is offline Community Advocate leafypiggy is on a distinguished road
    Join Date
    Aug 2007
    Location
    Massachusetts
    Posts
    2,228
    Your host should be localhost, and your username is your cpanel username followed by the db username (same goes for database name) (Where my cPanel name is "leafy")

    For example, if I had user "test" and database "db":
    Neil Hanlon | x10Hosting Support Representative
    Neil[at]x10hosting.com
    █ I'm always happy to help. Just ask a question in Free Hosting
    Terms of Service IRC

  3. #3
    v1air80 is offline x10Hosting Member v1air80 is an unknown quantity at this point
    Join Date
    Jul 2010
    Posts
    4

    Re: MySQL Table Creation Error

    Thanks for that.

    I put localhost in the script but it always displays that IP. I'll give it a shot.

    --EDIT--

    Just to double check...

    connect = mysql_connect("localhost","cpanel name","db name") or die ("Your have failed to connect");

    mysql_select_db("vabase");

    Just wondering because I thought you had to supply the host (localhost), then the database username and then password.
    Last edited by v1air80; 07-06-2010 at 03:58 PM.

  4. #4
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: MySQL Table Creation Error

    Try the suggestions in "I can't login to my cPanel on Fris! & Mysql isn't working!".

    You shouldn't use die in most PHP scripts.

    The old mysql driver is very outdated. Check out PDO; read "Writing MySQL Scripts with PHP and PDO" for a tutorial.
    Last edited by misson; 07-06-2010 at 08:36 PM.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

+ Reply to Thread

Similar Threads

  1. SQL table creation
    By eugee in forum Free Hosting
    Replies: 3
    Last Post: 04-01-2010, 02:03 PM
  2. mysql table structure help
    By saif7463 in forum Programming Help
    Replies: 5
    Last Post: 09-28-2009, 05:28 PM
  3. error on mysql table
    By batangas in forum Free Hosting
    Replies: 3
    Last Post: 06-07-2009, 01:16 PM
  4. MysQL Query for Master table & child table
    By phpasks in forum Programming Help
    Replies: 8
    Last Post: 08-07-2008, 08:07 AM
  5. MySql User Table
    By brAddict in forum Scripts & 3rd Party Apps
    Replies: 6
    Last Post: 09-05-2007, 06:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers