日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

树莓派安装mysql5.6_Linux上安装MySQL5.6

發布時間:2025/3/15 数据库 12 豆豆
生活随笔 收集整理的這篇文章主要介紹了 树莓派安装mysql5.6_Linux上安装MySQL5.6 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

OS & MySQL的版本號和配置:

MySQL Version: 5.6.19Linux Version: Linux boston.oracle.com 2.6.18-164.el5 #1 SMP Thu Sep 3 02:16:47 EDT 2009 i686 i686 i386 GNU/Linux

一。下載MySQL安裝軟件。請到www.oracle.com去找DATABASE DOWNLOAD。下載MySQL須要注冊一個賬號。

我下載的版本號例如以下:

下載后解壓就是下面的8個文件 :

二, 在Linux上安裝MySQL(一個server程序和一個client程序)

[root@vmoel5u4 mysql_installer]# ll

total 115896

-rw-r--r-- 1 root root 22925106 May? 8? 2014 MySQL-client-advanced-5.6.19-1.rhel5.i386.rpm

-rw-r--r-- 1 root root 95621549 May? 8? 2014 MySQL-server-advanced-5.6.19-1.rhel5.i386.rpm

--安裝Server端:

[root@vmoel5u4 mysql_installer]# rpm -ivh MySQL-server-advanced-5.6.19-1.rhel5.i386.rpm

Preparing...??????????????? ########################################### [100%]

1:MySQL-server-advanced? ########################################### [100%]

2012-11-18 00:34:49 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2012-11-18 00:34:49 16251 [Note] InnoDB: Using mutexes to ref count buffer pool pages

2012-11-18 00:34:49 16251 [Note] InnoDB: The InnoDB memory heap is disabled

2012-11-18 00:34:49 16251 [Note] InnoDB: Mutexes and rw_locks use InnoDB's own implementation

2012-11-18 00:34:49 16251 [Note] InnoDB: Compressed tables use zlib 1.2.3

2012-11-18 00:34:49 16251 [Note] InnoDB: Using Linux native AIO

2012-11-18 00:34:49 16251 [Note] InnoDB: Not using CPU crc32 instructions

2012-11-18 00:34:49 16251 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2012-11-18 00:34:49 16251 [Note] InnoDB: Completed initialization of buffer pool

2012-11-18 00:34:49 16251 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!

2012-11-18 00:34:49 16251 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB

2012-11-18 00:34:49 16251 [Note] InnoDB: Database physically writes the file full: wait...

2012-11-18 00:34:49 16251 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB

2012-11-18 00:34:50 16251 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB

2012-11-18 00:34:50 16251 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0

2012-11-18 00:34:50 16251 [Warning] InnoDB: New log files created, LSN=45781

2012-11-18 00:34:50 16251 [Note] InnoDB: Doublewrite buffer not found: creating new

2012-11-18 00:34:50 16251 [Note] InnoDB: Doublewrite buffer created

2012-11-18 00:34:50 16251 [Note] InnoDB: 128 rollback segment(s) are active.

2012-11-18 00:34:50 16251 [Warning] InnoDB: Creating foreign key constraint system tables.

2012-11-18 00:34:50 16251 [Note] InnoDB: Foreign key constraint system tables created

2012-11-18 00:34:50 16251 [Note] InnoDB: Creating tablespace and datafile system tables.

2012-11-18 00:34:50 16251 [Note] InnoDB: Tablespace and datafile system tables created.

2012-11-18 00:34:50 16251 [Note] InnoDB: Waiting for purge to start

2012-11-18 00:34:50 16251 [Note] InnoDB: 5.6.19 started; log sequence number 0

2012-11-18 00:34:50 16251 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.

2012-11-18 00:34:50 16251 [Note] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.

A random root password has been set. You will find it in '/root/.mysql_secret'.

2012-11-18 00:34:51 16251 [Note] Binlog end

2012-11-18 00:34:51 16251 [Note] InnoDB: FTS optimize thread exiting.

2012-11-18 00:34:51 16251 [Note] InnoDB: Starting shutdown...

2012-11-18 00:34:53 16251 [Note] InnoDB: Shutdown completed; log sequence number 1625977

2012-11-18 00:34:53 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2012-11-18 00:34:53 16282 [Note] InnoDB: Using mutexes to ref count buffer pool pages

2012-11-18 00:34:53 16282 [Note] InnoDB: The InnoDB memory heap is disabled

2012-11-18 00:34:53 16282 [Note] InnoDB: Mutexes and rw_locks use InnoDB's own implementation

2012-11-18 00:34:53 16282 [Note] InnoDB: Compressed tables use zlib 1.2.3

2012-11-18 00:34:53 16282 [Note] InnoDB: Using Linux native AIO

2012-11-18 00:34:53 16282 [Note] InnoDB: Not using CPU crc32 instructions

2012-11-18 00:34:53 16282 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2012-11-18 00:34:53 16282 [Note] InnoDB: Completed initialization of buffer pool

2012-11-18 00:34:53 16282 [Note] InnoDB: Highest supported file format is Barracuda.

2012-11-18 00:34:53 16282 [Note] InnoDB: 128 rollback segment(s) are active.

2012-11-18 00:34:53 16282 [Note] InnoDB: Waiting for purge to start

2012-11-18 00:34:53 16282 [Note] InnoDB: 5.6.19 started; log sequence number 1625977

2012-11-18 00:34:53 16282 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.

2012-11-18 00:34:53 16282 [Note] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.

2012-11-18 00:34:53 16282 [Note] Binlog end

2012-11-18 00:34:53 16282 [Note] InnoDB: FTS optimize thread exiting.

2012-11-18 00:34:53 16282 [Note] InnoDB: Starting shutdown...

2012-11-18 00:34:55 16282 [Note] InnoDB: Shutdown completed; log sequence number 1625987

A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !

You will find that password in '/root/.mysql_secret'.

You must change that password on your first connect,

no other statement but 'SET PASSWORD' will be accepted.

See the manual for the semantics of the 'password expired' flag.

Also, the account for the anonymous user has been removed.

In addition, you can run:

/usr/bin/mysql_secure_installation

which will also give you the option of removing the test database.

This is strongly recommended for production servers.

/*? 上面的紅色的大概意思例如以下:

為MySQL的數據庫的root的用戶生成了一個隨機的秘密,請到/root/.mysql_secret里去找password。

當你第一次登陸時必須改動password,同一時候匿名帳號已經被刪除掉了。

除此之外,你能夠運行:

/usr/bin/mysql_secure_installation

他能夠給你一些移除test 數據庫的選項。

強烈推薦在生產server上做此操作。

*/

See the manual for more instructions.

Please report any problems athttp://bugs.mysql.com/

The latest information about MySQL is available on the web at

Support MySQL by buying support/licenses at

http://shop.mysql.com

New default config file was created as /usr/my.cnf and

will be used by default by the server when you start it.

You may edit this file to change server settings

--安裝Client端:

[root@vmoel5u4 mysql_installer]# rpm -ivh MySQL-client-advanced-5.6.19-1.rhel5.i386.rpm

Preparing...??????????????? ########################################### [100%]

1:MySQL-client-advanced? ########################################### [100%]

三,MySQL 數據庫的配置

1。啟動MySQL服務

[root@vmoel5u4 mysql_installer]# cd /etc/rc.d/init.d

[root@vmoel5u4 init.d]# service mysql start

Starting MySQL..........?????????????????????????????????? [? OK? ]

2。改動MySQL數據庫root用戶的初始password,先查下初始password

[root@vmoel5u4 mysql_installer]# vi /root/.mysql_secret

# The random password set for the root user at Sun Nov 18 00:34:51 2012 (local time): kX65UtYvovXN9VOV

從上面能夠初始password是:kX65UtYvovXN9VOV

[root@vmoel5u4 init.d]# mysql -uroot -p

Enter password:

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

Your MySQL connection id is 15

Server version: 5.6.19-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)

Copyright (c) 2000, 2014, 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>

/*改動password為123456*/

mysql> update user set password=PASSWORD('123456') where user='root';

Query OK, 3 rows affected (0.00 sec)

Rows matched: 3? Changed: 3? Warnings: 0

/*刷新權限表*/

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

3。用新password123456登陸MySQL

[root@vmoel5u4 init.d]# mysql -uroot -p

Enter password:

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

Your MySQL connection id is 16

Server version: 5.6.19-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)

Copyright (c) 2000, 2014, 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> use mysql ;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

Database changed

mysql> select Host,User,Password from user;

+-----------+------+-------------------------------------------+

| Host????? | User | Password????????????????????????????????? |

+-----------+------+-------------------------------------------+

| localhost | root | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |

| 127.0.0.1 | root | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |

| ::1?????? | root | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |

+-----------+------+-------------------------------------------+

3 rows in set (0.00 sec)

4, 創建新的表test,并插入測試數據

mysql> create table test(id int);

Query OK, 0 rows affected (0.05 sec)

mysql> insert into test(id) values(1);

Query OK, 1 row affected (0.05 sec)

mysql> insert into test(id) values(2);

Query OK, 1 row affected (0.01 sec)

mysql> commit;

Query OK, 0 rows affected (0.00 sec)

mysql> select * from test;

+------+

| id?? |

+------+

|??? 1 |

|??? 2 |

+------+

2 rows in set (0.02 sec)

四,MySQL通過RPM包安裝后的路徑布局

Directory???????????????????????????????????????????????????????? Contents of Directory

/usr/bin?????????????????????????????????????????????????????????? Client programs and scripts

/usr/sbin???????????????????????????????????????????????????????? The mysqld server

/var/lib/mysql???????????????????????????????????????????????? ?Log files, databases

/usr/share/info??????????????????????????????????????????????? Manual in Info format

/usr/share/man????????????????????????????????????????????? Unix manual pages

/usr/include/mysql?????????????????????????????????????????Include (header) files

/usr/lib/mysql????????????????????????????????????????????????? Libraries

/usr/share/mysql?????????????????????????????????????????? Miscellaneous support files, including error messages, character set files, sample configuration files, SQL for? database installation

/usr/share/sql-bench????????????????????????????????? ?Benchmarks

From MySQL5.6 version, During RPM installation, a user named mysql and a group named mysql are created on the system. This is done using the useradd, groupadd, and usermod commands. Those commands require appropriate administrative privileges, which is required

for locally managed users and groups (as listed in the /etc/passwd and /etc/group files) by the RPM installation process being run by root.

安裝5.6版本號的MySQL的時候,RPM安裝包會自己主動的創建mysql 組合mysql用戶。

創建mysql的CDDL數據庫的新用戶watson

use mysql

mysql>create user 'watson'@'172.30.41.93' identified by 'watson';

mysql>grant all on cddl.* to 'watson'@'172.30.41.93';

總結

以上是生活随笔為你收集整理的树莓派安装mysql5.6_Linux上安装MySQL5.6的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。