change database name mysql code example

Example 1: change column name mysql command line

ALTER TABLE `members` CHANGE COLUMN `full_names` `fullname` varchar(100) NOT NULL;

Example 2: how to edit table name in mysql

RENAME TABLE tb1 TO tb2;

Example 3: change column name mysql

ALTER TABLE tableName CHANGE `oldcolname` `newcolname` datatype(length);
(you can remove the backticks if it doesn't work)

Example 4: create database in mysql

The CREATE DATABASE statement is used to create a new SQL/MySQL database.

Syntax
CREATE DATABASE databasename;

CREATE DATABASE Example
The following SQL statement creates a database called "testDB":

Example
CREATE DATABASE testDB;

Example 5: change name of user mysql

RENAME USER old_user1 
TO new_user;

Tags:

Sql Example