Hi folks, I have XAMPS php software, we wanna run to database Please tell me how to create database in mysql in xamps.
Depends how can you access the server? You can create MySql database through your browser by pointing it to http://IP_address_of_your_server and then clicking on phpMyadmin You can create databases and tables using the command line as well. mysql> CREATE DATABASE ''databasename''; mysql> GRANT ALL PRIVILEGES ON ''databasename''.* TO "''username''"@"''hostname''" IDENTIFIED BY "''password''"; mysql> FLUSH PRIVILEGES; mysql> EXIT Code (markup): Third, you can create databases and tables with PHP files : <?php $con = mysql_connect("localhost","username","password"); if (!$con) { die('Could not connect: ' . mysql_error()); } if (mysql_query("CREATE DATABASE my_db",$con)) { echo "Database created"; } else { echo "Error creating database: " . mysql_error(); } mysql_close($con); ?> PHP: Good luck!
I am using xampp and its http://localhost/phpmyadmin/. I think its the same. look for documentations for xamps.
Personally I prefer using navicat. You can get a free version at the following location (navicat lite) or the full version http://www.navicat.com/download/download.html