Flipkart

Showing posts with label MySQL. Show all posts
Showing posts with label MySQL. Show all posts

Monday, June 25, 2018

Backup MySQL Database using command line in Windows

Say you get a request to take backup of Test1234 .

Run cmd change directory & run following command.

C:\Program Files\MySQL\MySQL Server 5.1\bin>mysql -u root -p Test1234 > C:/Users/admin/Desktop

/Test1234.sql

Enter password: ****

Create new MySQL tablespace using command line in Windows

Create a new database using command line

Run cmd & change directory

C:\Users>cd..

C:\>cd "Program Files"

C:\Program Files>cd MySQL

C:\Program Files\MySQL>cd "MySQL Server 5.1"

C:\Program Files\MySQL\MySQL Server 5.1>cd bin

Now, connect MySQL using this command mysql -u root -p

C:\Program Files\MySQL\MySQL Server 5.1\bin>mysql -u root -p

Enter password: ****

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 9

Server version: 5.1.73-community MySQL Community Server (GPL) Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database test1234;

Query OK, 1 row affected (0.04 sec)

mysql> grant all privileges on test1234.* to test1234@localhost identified by "1234";

Query OK, 0 rows affected (0.10 sec)