In this article, we will see how to create Azure MySQL Database. Like MySQL on-premise server, we dont have multiple methods to create database in Azure MySQL Server. We can database in Azure MySQL server using MySQL Workbench. To create database in Azure MySQL server, logged in user must
Tag: Database
How to create user in Azure MySQL database
In this article, we will see how create user in Azure MySQL database. We are going to create user in Azure MySQL server by using two ways.
1. Using GUI methods.
2. Using Create user statement.
1. Create User in Azure MySQL Database using Create User command:
Syntax to create MySQL User:
Continue reading How to create user in Azure MySQL database
How to get list of databases in MySQL
In this article, we will see how to get list of databases in MySQL. We can get list of databases in MySQL server using SHOW command. The SHOW SCHEMAS command is a synonym for SHOW DATABASES.
Syntax:
SHOW {DATABASES | SCHEMAS} [LIKE 'pattern' | WHERE expr];
MySQL Ignoring query to other database
In this article, we will find the solution for “MySQL Ignoring query to other database”,
Cause and Resolution:
Cause:
I keep on getting this weird message, while executing any query in command prompt MySQL. I have tried to changing to all databases in my MySQL server. But error remains same.
Reason: I had missed the “u” flag for user so accidentally I had input the following command.
mysql -root -p
Solution:
Connect to MySQL Server with all flags as shown below. Then, error gone.
mysql -u root -p
So, from the above solution u is missing flag while connected to MySQL Server.
How to Rename a Database in MySQL
In this article, we will see how to Rename a Database in MySQL. In previous versions of MySQL, RENAME DATABASE is used to rename database. From all newer versions, RENAME DATABASE has been removed to avoid security risks.
We can rename database in MySQL using dump and restore process.
Steps to Rename a Database in MySQL:
mysqldump syntax:
mysqldump –u [UserName] –p[Password] –R [DB_Name] > [DB_Name].sql
Replace [UserName] and [Password] with the actual credentials for the database, and replace [DB_Name] with the exact name of the database you’re changing. There should be no space between -p and the password. The -R flag indicates that the dump file should retain all stored procedures and functions.
1) Create dump using mysqldump tool. Here r2schools is the database name.
mysqldump -u root -p -R r2schools > r2schools.sql
How to find current database in MySQL
In this article, we will see how to find current database in MySQL. The most common way to get current active MySQL database is by using the MySQL SELECT DATABASE() command & status command.
Examples to find current database in MySQL
How to create database in MySQL
In this article, we are going to see how to create database in MySQL. We are going to definition of database, syntax to create database and examples to create and drop database.
1. Definition of Database:
Continue reading How to create database in MySQL