mysql update mysql user set password password 4321 where user root mys

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
mysql> update mysql.user set password=password('4321') where user='root';
C:\>mysql -uroot -p
Welcome to the MySQL monitor. Commands end with ; or \g.
C:\>mysqldump -uroot -p bookshop > C:/bookshop.sql
Warning: Using a password on the command line interface can be insecure.
DROP DATABASE bookshop;
CREATE DATABASE bookshop;
C:\>mysql -uroot -p bookshop < c:/bookshop.sql
C:\>mysqldump -uroot -p -help
-- MySQL dump 10.13 Distrib 5.6.21, for Win32 (x86)
--
-- Host: localhost Database: –¶help
-- ------------------------------------------------------
-- Server version 5.6.21-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
mysqldump: Got error: 1049: Unknown database '?help' when selecting the database
C:\>mysqldump -uroot -p --all-databases > all_databases.sql
C:\>mysqldump -uroot -p -X bookshop > C:/bookshop.xml