Results 1 to 8 of 8

Thread: Creating MySQL User and Password through PHP

  1. #1
    Join Date
    Oct 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Creating MySQL User and Password through PHP

    Hey,

    I'm having a problem with a PHP code I'm working on.

    I'm trying to create a MySQL user and password through PHP.

    I haven't been able to find a straight foward answer to this problem anywhere.

    Does anyone know how to do this?

    Thank you.

  2. #2
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    You don't "create" a MySql database with PHP. Your server has to have it enabled, and sometimes they'll have phpmyadmin with it too.
    - Mike

  3. #3
    Join Date
    Oct 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I know.

    I have PHPMyAdmin, but I'm trying to create a user with a password with PHP.

    Example: To create a database...$query = mysql_query('CREATE DATABASE name');

    Is there a way to use something similar to the script above to do this?
    Last edited by Unseen Ghost; 02-20-2007 at 09:09 PM.

  4. #4
    Join Date
    Feb 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    there's a lot of simple tutorial regarding this topic on the search engine. First learn to how to insert a data thru mysql then learn how to query the inserted data from the dbase. Simple insert and select function

  5. #5
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

  6. #6
    Join Date
    Oct 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I guess I'm not explaining myself very well.

    I'm trying to create a MySQL database User ans password using PHP.

    I know how to connect to the server, but If I don't have a User or password, it does me no good.

    I'm trying to create the user ans pass so I can use it to connect to the server.

  7. #7
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    This isn't done through PHP, it's done via mysql. Log in as "root" with an empty password the first time, and change that password ASAP. If you can't log in as root, then it's likely your host has set a default password. Ask them to give it to you.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  8. #8
    Join Date
    Oct 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank You.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •