Re: Creating Mysql DB with PHP
- From: "Tony" <someone@xxxxxxxxxxxxx>
- Date: Mon, 6 Jun 2005 17:13:02 -0700
"MS" <nospamplaesegr8t_ukuk@xxxxxxxxxxx> wrote in message
news:d81sbd$5st$1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>
>
> My current DB is on my Linux Server, and I don't have access to any MYSQL
> directories.
> So I think what you are suggesting is not viable for me.
>
> would another possibility be to...
>
> create a PHP file to run SQL that would create the DB and all the tables.
> This I don't see a problem with.
You were also asking to duplicate data, though - and that could present a
problem, depending on how much data you're copying. If it's not too much,
you may be ok.
As for setting up the database & tables, that's pretty straightforward -
just use mysql_query() to send the appropriate queries to the database. In
fact, you should probably use that for creating the database, too, since
mysql_create_db is deprecated - it's better practice to get into.
> but how do you set the connection values...'mysql_user' & 'mysql_password'
> within php and relate this to the DB that is to be created.
>
> mysql_connect('localhost', 'mysql_user', 'mysql_password') ;
basically, you just set them either as strings in the command, or as string
variables. So for user="root" and password="rootpw":
mysql_connect('localhost',' root','rootpw');
or
$host = "localhost";
$user = "root";
$password = "rootpw";
<... any other code can be here if it doesn't change these variables ...>
mysql_connect($host,$user,$password);
You just have to be sure that the user & password you're using have been
entered into the database.
.
- Follow-Ups:
- Re: Creating Mysql DB with PHP
- From: MS
- Re: Creating Mysql DB with PHP
- References:
- Creating Mysql DB with PHP
- From: MS
- Re: Creating Mysql DB with PHP
- From: Tony
- Re: Creating Mysql DB with PHP
- From: MS
- Re: Creating Mysql DB with PHP
- From: Tony
- Re: Creating Mysql DB with PHP
- From: MS
- Re: Creating Mysql DB with PHP
- From: Tony
- Re: Creating Mysql DB with PHP
- From: MS
- Re: Creating Mysql DB with PHP
- From: Tony
- Re: Creating Mysql DB with PHP
- From: MS
- Creating Mysql DB with PHP
- Prev by Date: PHP PROGRAMMING HELP??
- Next by Date: LDAP help
- Previous by thread: Re: Creating Mysql DB with PHP
- Next by thread: Re: Creating Mysql DB with PHP
- Index(es):
Relevant Pages
|