View Full Version : mySQL DB Setup Question
this may sound a little vague but i am a bit cofused!!.
in the ops settings under mysql in shows (no users) Do i need to add a user or is there already a main user setup?? eg.. when i setup to have mySQL add to our account i setup it up with our DB name of acedata do i use this or do i still have to add a user in the ops control panel??
thanks in advance
Chunks
Atomic-Design
4-15-02, 11:23 PM
Your database is setup. Even though you have a database, you don't have a user to access it. Add a new user with all privledges. This will be your username when you logon to your database. I was also confused at first when I setup my database. When you login to the database, you do not use your PowWeb Member Ops info. (unless of course they are the same thing. I made my MySQL user different, to avoid confusion).
thanks for that!!!
that will hrlp greatly
Chunks
Atomic-Design
4-15-02, 11:46 PM
This is a great way to connect to MySQL:
<?php
$user = "The Database User You Added";
$pass = "The Password To Your User";
$db = "You're Database Name";
// The database is the top row in the MySQL area
$link = mysql_connect("localhost",$user,$pass);
if (!$link)
die("Couldn't connect to MySQL");
mysql_select_db($db,$link)
or die("Couldn't select $db: ".mysql_error());
This will even tell you the errors. If you don't understand the code, I'd be glad to explain it to you.
thanks for the reply
ive got a big fat book ive started reading and i sorta understang whats happening with the script... one qustion though.. is the DB server for powweb "localhost" or according to OPS>mySQL> "meteor.powweb.com". if you could answer this it will help me get started a little more smoothly with setting up phpbb2...
Thanks once again..
Chunks
...the responce time to questions on this board are awsome!!
I've just started running PHP and MySQL on my home box for learning and testing, and one thing I learned the other day is: putting an @ sign in front of the mysql_connect() function...
$link = @mysql_connect("localhost",$user,$pass);
...will suppress any MySQL errors in case of a non-connection and only show your die message. Of course, it's probably not too often that you'll get a MySQL non-connection error anyway, but...
I'm not sure it works with PowWeb's servers, but it works that way here at home.
On the other hand, you might want to see the MySQL squawks before your die message.
vBulletin v3.6.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.