[MySQL实践] 实践记录
生活随笔
收集整理的這篇文章主要介紹了
[MySQL实践] 实践记录
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
[MySQL實踐] 實踐記錄
版權2019.5.17更新
MySQL
MySQL各版本區(qū)別
一、選擇的版本1. MySQL Community Server 社區(qū)版本,開源免費,但不提供官方技術支持。 2. MySQL Enterprise Edition 企業(yè)版本,需付費,可以試用30天。 3. MySQL Cluster 集群版,開源免費。可將幾個MySQL Server封裝成一個Server。 4. MySQL Cluster CGE 高級集群版,需付費。 5. MySQL Workbench(GUI TOOL)一款專為MySQL設計的ER/數(shù)據(jù)庫建模工具。它是著名的數(shù)據(jù)庫設計工具DBDesigner4的繼任者。MySQL Workbench又分為兩個版本,分別是社區(qū)版(MySQL Workbench OSS)、商用版(MySQL Workbench SE)。macOS系統(tǒng)brew安裝:
(base) tp0829 at MacBook-Pro-TP in ~ $ brew install mysql ==> Downloading https://homebrew.bintray.com/bottles/mysql-8.0.16.mojave.bottle.tar.gz ==> Downloading from https://akamai.bintray.com/65/65e6629740ca75ceaae575b4cc68f2cf133619d08cdcd4cb2 ######################################################################## 100.0% ==> Pouring mysql-8.0.16.mojave.bottle.tar.gz ==> /usr/local/Cellar/mysql/8.0.16/bin/mysqld --initialize-insecure --user=tp0829 --basedir=/usr/loc ==> Caveats We've installed your MySQL database without a root password. To secure it run:mysql_secure_installationMySQL is configured to only allow connections from localhost by defaultTo connect run:mysql -urootTo have launchd start mysql now and restart at login:brew services start mysql Or, if you don't want/need a background service you can just run:mysql.server start ==> Summary ? /usr/local/Cellar/mysql/8.0.16: 275 files, 269.8MB ==> `brew cleanup` has not been run in 30 days, running now... Removing: /usr/local/Cellar/gdbm/1.14.1_1... (20 files, 555.7KB) Removing: /usr/local/Cellar/gdbm/1.16... (19 files, 578.5KB) Removing: /usr/local/Cellar/openssl/1.0.2q... (1,794 files, 12.1MB) Pruned 0 symbolic links and 5 directories from /usr/local(base) tp0829 at MacBook-Pro-TP in ~ $ (base) tp0829 at MacBook-Pro-TP in ~ $ mysql_secure_installationSecuring the MySQL server deployment.Enter password for user root: Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (base) tp0829 at MacBook-Pro-TP in ~ $ mysql -uroot ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (base) tp0829 at MacBook-Pro-TP in ~ $ brew services start mysql ==> Successfully started `mysql` (label: homebrew.mxcl.mysql) (base) tp0829 at MacBook-Pro-TP in ~ $ mysql_secure_installationSecuring the MySQL server deployment.Connecting to MySQL using a blank password.VALIDATE PASSWORD COMPONENT can be used to test passwords and improve security. It checks the strength of password and allows the users to set only those passwords which are secure enough. Would you like to setup VALIDATE PASSWORD component?Press y|Y for Yes, any other key for No: n Please set the password for root here.New password: #123456Re-enter new password: By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment.Remove anonymous users? (Press y|Y for Yes, any other key for No) : y Success.Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.Disallow root login remotely? (Press y|Y for Yes, any other key for No) : n... skipping. By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment.Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y- Dropping test database... Success.- Removing privileges on test database... Success.Reloading the privilege tables will ensure that all changes made so far will take effect immediately.Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y Success.All done! (base) tp0829 at MacBook-Pro-TP in ~ $Homebrew Services
參考:
https://www.jianshu.com/p/6c3b26490861
https://github.com/Homebrew/homebrew-services
https://www.jianshu.com/p/90939b788004
Homebrew Services Integrates Homebrew formulae with macOS' launchctl manager. macOS使用launchctl命令加載開機自動運行的服務,brew service可以簡化lauchctl的操作。Install brew services is automatically installed when run. 在使用時會自動安裝Usage Start Start the MySQL service at login with:brew services start mysql Start the Dnsmasq service at boot with:sudo brew services start dnsmasq Start all available services with:brew services start --all Run Run the MySQL service but don't start it at login (nor boot) with:brew services run mysql Stop Stop the MySQL service with:brew services stop mysql Restart Restart the MySQL service with:brew services restart mysql List List all services managed by brew services with:brew services list Cleanup Remove all unused services with:brew services cleanup|版權聲明:除特別注明外,本博客所有文章均為博主T.P原創(chuàng),轉載請注明出處:https://www.cnblogs.com/tp0829/p/10801245.html
轉載于:https://www.cnblogs.com/tp0829/p/10891493.html
總結
以上是生活随笔為你收集整理的[MySQL实践] 实践记录的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Tips——RN webview如何实现
- 下一篇: 关于Linux的基础中的基础和一些基础小