1. 程式人生 > >mysql8基礎 warnings 開啟與關閉警告自動輸出功能

mysql8基礎 warnings 開啟與關閉警告自動輸出功能

資料,資料,命根就在資料 ! 操作資料庫時,一定要謹慎小心。師萬物 的程式碼看看就好,要有自己的判斷。遇到抉擇,要不恥上下問。

example

stu@Ubuntu:~$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 88
Server version: 8.0.12 MySQL Community Server - GPL

Copyright (c) 2000, 2018, 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 if not exists db_herbal_medicine; Query OK,
1 row affected, 1 warning (0.00 sec) mysql> warnings; Show warnings enabled. mysql> create database if not exists db_herbal_medicine; Query OK, 1 row affected, 1 warning (0.00 sec) Note (Code 1007): Can't create database 'db_herbal_medicine'; database exists mysql> exit Bye stu@Ubuntu:~$

more knowledge

  • 在[2]中提到的:\W 與 \w。
  • 基於MySQL8的命令執行效果如下
stu@Ubuntu:~$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 90
Server version: 8.0.12 MySQL Community Server - GPL

Copyright (c) 2000, 2018, 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> \W
Show warnings enabled.
mysql> \w
Show warnings disabled.
mysql> exit
Bye
stu@Ubuntu:~$ 

reference

resource

MySQL是一個關係型資料庫管理系統,目前是開源的(2018-10)。
許可權明確,引擎與字符集等選擇恰當,命名規範。
MariaDB,Redis,MongoDB,PostgreSQL,Hive,HBase等,多作了解,拓寬心量。
Workbench,phpMyAdmin,Navicat等圖形化管理工具,豫兮若冬涉川。