Create a Database
The CREATE DATABASE statement is used to create a database in MySQL.
We must add the CREATE DATABASE statement to the mysqli_query() function to execute the command.
InetServices offers both Windows and Linux bare metal server hosting, and cloud server hosting for any small to medium size business. We also offer both PCI and HIPAA Compliant servers allowing you to achieve PCI or HIPAA Compliance without all the worries of figuring it out. InetServices offers much more than just dedicated servers and cloud servers, we offer you a complete solution to your hosting needs including Big Data, Disaster Recovery, and High Availability services.
The CREATE DATABASE statement is used to create a database in MySQL.
We must add the CREATE DATABASE statement to the mysqli_query() function to execute the command.
Use the PHP mysqli_connect() function to open a new connection to the MySQL server.
Before we can access data in a database, we must open a connection to the MySQL server.
The mysqlhotcopy utility is a perl script that uses several basic system and SQL commands to backup a database. More specifically, it will lock the tables, flush the tables, make a copy, and unlock the tables. Although it is the fastest method available for backing up a MySQL database, it is limited to backing up only those databases residing on the same machine as where it is executed.
The REVOKE command is used to rescind privileges previously granted to a user. Its syntax is:
REVOKE priv_type [(column_list)] [, priv_type [(column_list)] ...] ON {tbl_name | * | *.* | db_name.*} FROM user_name [, user_name ...]
The GRANT function is used both to create new users, and to assign privileges to users. Its syntax is:
mysql>GRANT priv_type [(column_list)] [, priv_type [(column_list)] ...] ON {tbl_name | * | *.* | db_name.*} TO user_name [IDENTIFIED BY 'password'] [, user_name [IDENTIFIED BY 'password'] ...] [WITH GRANT OPTION]
Security should be the first thought that comes to a MySQL administrator’s mind after creating a new database. Privilege as was discussed in the section, “The Privilege Tables”, securing a database is accomplished through modifications made to the tables found in the mysql database. In this section,
The mysqladmin program is used to administrate various aspects of the MySQL database server. Using it, the administrator can perform tasks such as: create and delete databases, shutdown the database server, update the privilege tables, and view running MySQL processes. The general syntax is:
Read More
Of course, simply connecting to the MySQL server isn’t going to accomplish much. Chances are you will want to select a database to work with. This is accomplished in one of two ways:
The MySQL client program, also known as the MySQL monitor, is an interface that allows the user to connect to the MySQL server, create and modify databases, and execute queries and view their results. This program is started by executing the command mysql at the shell prompt. In general, the syntax for this command is:
It’s very likely that the first task the administrator will want to undertake is proper configuration of MySQL’s configuration file. This file, entitled my.cnf, stores default startup options for both the server and for clients. Correct configuration of this file can go a long way towards optimizing MySQL, as various memory buffer settings and other valuable options can be set here.