View Full Version : Creating MySQL User and Password through PHP
Unseen Ghost
02-20-2007, 08:06 PM
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. :)
mburt
02-20-2007, 08:38 PM
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.
Unseen Ghost
02-20-2007, 08:52 PM
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?
eli03
02-20-2007, 09:23 PM
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 :)
mburt
02-20-2007, 09:26 PM
http://mburt.funpic.org/wiki/?p=libresult&title=PHP/MySql
Unseen Ghost
02-20-2007, 09:36 PM
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.
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.
Unseen Ghost
02-21-2007, 01:57 AM
Thank You.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.