I am trying to create database with user. Which contain the information about user id, user address, user name with user age in form of table. Is there any way to programmatically create a database and setup users for MySQL.
I am trying to create database with user. Which contain the information about user id, user address, user name with user age in form of table. Is there any way to programmatically create a database and setup users for MySQL.
When you try to connect database programmatically you have to switch between the local computer and the server. To connect database use the following program :
Code:<?php function connect_database() { $user_name =""; $password=""; $database_name="local_database_name"; $db_host="localhost"; $db=mysql_connect($db_host, $user_name, $password); if (mysql_error() > "") print mysql_error() . "<br>"; mysql_select_db($database_name, $db); if (mysql_error() > "") print mysql_error() . "<br>"; } ?>
If you want to connect database as root or any other user with all access :
create database mydb;
Grant all permission on database;
delete privileges;
to myuser at my host identify by mypass;
Bookmarks