MariaDB ubuntu install guide
Install Command
這些都是ubuntu下常用的幾個MySQL/MariaDB命令,剛好最近用到,發現之前沒存,趁機儲存一波。
#by https://blog.csdn.net/moshowgame
#安裝mariadb 10.3,如果是想用mysql則改為mysql-server
sudo apt install mariadb-server
#進入mysql/mariadb控制檯
sudo mysql -u root -p
#重置密碼
SET password=PASSWORD('root123');
#重新整理配置
flush privilege;
#進入配置模式嚮導
sudo mysql_secure_installation
#重啟mysql/mariadb(更改配置或更改密碼後建議重啟/重載入一下)
sudo systemctl restart mysql
#停止mysql/mariadb
sudo systemctl stop mysql
#啟動mysql/mariadb
sudo systemctl start mysql
install mariadb-server
ubunu下安裝必須方面,基本一句話就搞定!
mysql_secure_installation
mysql_secure_installation
會執行幾個設定,建議生產環境中mysql安裝這完成後一定要執行一次mysql_secure_installation:
- 為root使用者設定密碼
- 設定是否允許匿名賬號登入
- 設定是否取消root使用者遠端登入
- 設定是否刪除test庫和對test庫的訪問許可權
- 重新整理授權表使修改生效
Source匯入sql檔案
navicat提供了非常方面的匯入匯出功能,但是MariaDB和MySQL裡面其實是有命令列模式的。
就是 source
命令。另外,如果需要在一個sql語句中匯入多個sql檔案,可以新建一個sql檔案,裡面存放如下命令:
SOURCE test1.sql;
SOURCE test2.sql;
#顯示所有資料庫
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+
3 rows in set (0.001 sec)
#建立資料庫
MariaDB [(none)]> create database mscms;
Query OK, 1 row affected (0.000 sec)
#進入某個資料庫
MariaDB [(none)]> use mscms;
Database changed
#匯入資料庫sql檔案
MariaDB [mscms]> source /home/moshow/Development/Workspace/mcms/doc/db-mcms-mysql-4.7.1.sql;
#匯入過程
Query OK, 0 rows affected (0.000 sec)
......
相關文章
- mariadb install on Ubuntu 16.04.1 LUbuntu
- Ubuntu 18.04 install albertUbuntu
- How to Install LibreOffice on UbuntuUbuntu
- 在Ubuntu上安裝MariaDBUbuntu
- Install erlang to Ubuntu 18.04 LTSUbuntu
- Install Rabbitmq to Ubuntu 18.04 LTSMQUbuntu
- Node JS Install - Ubuntu systemJSUbuntu
- Install Papirus Icon Theme on UbuntuAPIUbuntu
- Ubuntu安裝Lighttpd、PHP和MariaDBUbuntuhttpdPHP
- Install Docker CE for Ubuntu 18.04 LTSDockerUbuntu
- Install Redis to Ubuntu18.04 LTSRedisUbuntu
- How to Install and Configure VNC on Ubuntu 18.04VNCUbuntu
- Install linux mint apt to Ubuntu 18.04 LTSLinuxAPTUbuntu
- UBUNTU安裝kaldi遇到關於not install OpenFst errorUbuntuNFSError
- Flexbox GuideFlexGUIIDE
- A guide to this in JavaScriptGUIIDEJavaScript
- Meterpreter GuideGUIIDE
- Guide to app architectureGUIIDEAPP
- crontab usage guideGUIIDE
- Setup MariaDB Master/Slave Replication for Docker MariaDBASTDocker
- Guide to Database as a Service (DBaaS)GUIIDEDatabase
- webpack Performance: The Comprehensive GuideWebORMGUIIDE
- The hater’s guide to KubernetesGUIIDE
- 【Java】A Guide to the Java ExecutorServiceJavaGUIIDE
- Merchant‘s Guide to the GalaxyGUIIDE
- 求助 :ubuntu 編譯核心後(make -jn),sudo make modules_install報錯Ubuntu編譯
- MariaDB安裝
- Learning MySQL and MariaDBMySql
- The Definitive Guide to CentOS.pdfGUIIDECentOS
- Notes about Vue Style GuideVueGUIIDE
- 2.4、User’s guide (Coroutines)GUIIDE
- An easy guide to object rest/spreadGUIIDEObjectREST
- ubuntu apt-get install xxx報錯無法下載的解決方法Ubuntuapt-get
- go install: no install location for directory outside GOPATHGoIDE
- semantic-ui@2.4.2 install: `gulp install`UI
- Core Animation Programming Guide Mind MappingGUIIDEAPP
- SAP SD Reference Guide: SAP NotesGUIIDE
- 【AP】a pratical guide to robust optimization(1)GUIIDE