redarrow Posted January 9, 2009 Share Posted January 9, 2009 Want to use a computer as a stand alone mysql server. STEP 1. download mysql database for windows. http://dev.mysql.com/downloads/mysql/5.1.html#win32 Install the application on your current computer. Add the password. STEP 2. GET YOUR CURRENT IP. Now find your current ip address for your current computer. Open local area connection select tab support write down your ip address. STEP 3. Press start/my programs/C drive/program files/my sql/mysql server 5.1/ highlight my.ini side click open with note pad. at the bottom off the file add this line. #IP address to bind to. bind-address=192.168.0.2 // Add the ip we saved earlier. save file then exit. STEP 4 Now use this script to insert a test database. Add your password and bind ip address <?php $db=mysql_connect("binded ip","root","your password")or die ('Database problam'.mysql_error()); $database_name='redarrow'; $sql="DROP DATABASE IF EXISTS $database_name"; mysql_query($sql)or die(mysql_error()); $sql="CREATE DATABASE $database_name"; $sql=mysql_query($sql)or die('Creating database problam'.mysql_error()); $sql="USE $database_name"; $sql=mysql_query($sql)or die('Use problam'.mysql_error()); $a='Congratulations'; $sql="CREATE TABLE $database_name($a varchar(15) NOT NULL);"; $sql=mysql_query($sql)or die('Creating table problam'.mysql_error()); $sql="INSERT INTO $database_name VALUES('$a')"; $sql=mysql_query($sql)or die('Insert problam'.mysql_error()); if(($sql)){ echo "Database $database_name created <BR><BR>"; $sql="SELECT * FROM $database_name"; $sql=mysql_query($sql)or die('Select problam'.mysql_error()); while($row=mysql_fetch_assoc($sql)){ echo $row[$a]; } } ?> Now you can use mysql with any editor in the world... and note pad. It faster to have a mysql database running alone while test you php scripts. Link to comment https://forums.phpfreaks.com/topic/140223-tutoral-use-one-off-your-pc-as-a-mysql-stand-alone-server-step-by-step/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.