91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

源碼安裝mysql

發布時間:2020-07-22 23:31:53 來源:網絡 閱讀:468 作者:Zach_legend 欄目:MySQL數據庫

創建mysql組:
groupadd mysql

創建mysql用戶并賦予這個mysq組中,不創建家目錄,不允許用戶登錄。(因為剛剛創建的mysql是虛擬用戶,所以不允許登錄)
useradd mysql -g mysql -M -s /bin/nologin

源碼安裝mysql
解壓后進行編譯安裝:
./configure \
--prefix=/application/mysql5.1.72 \
--with-unix-socket-path=/application/mysql5.1.72/tmp/mysql.sock \
--localstatedir=/application/mysql5.1.72/data \
--enable-assembler \
--enable-thread-safe-client \
--with-mysqld-user=mysql \
--with-big-tables \
--without-debug \
--with-pthread \
--enable-assembler \
--with-extra-charsets=complex \
--with-readline \
--with-ssl \
--with-embedded-server \
--enable-local-infile \
--with-plugins=partition,innobase \
--with-mysqld-ldflags=-all-static \
--with-client-ldflags=-all-static

make && make make install


安裝好后 創建mysql的軟鏈接:
ln -s /application/mysql5.1.72/ /application/apache

在該目錄下查看/usr/local/tools/mysql-5.1.72/support-files/下面cnf的配置文件    這些文件都是默認的配置文件的模版,適合與不同的場景
[root@node1 support-files]# ll  my*.cnf
-rw-r--r-- 1 root root  4746 05-04 02:49 my-huge.cnf         第四小            這些是根據服務器的硬件配置來衡量,服務器硬件過低,用最小的,配置高,用最大
-rw-r--r-- 1 root root 19779 05-04 02:49 my-innodb-heavy-4G.cnf     最大的
-rw-r--r-- 1 root root  4720 05-04 02:49 my-large.cnf        第三小
-rw-r--r-- 1 root root  4731 05-04 02:49 my-medium.cnf       最小的
-rw-r--r-- 1 root root  2499 05-04 02:49 my-small.cnf        第二小
然后將其中選擇適合你的服務器的配置文件拷貝到/etc下
[root@node1 support-files]# cp my-small.cnf /etc/my.cnf

創建mysql數據庫存放數據的目錄:
[root@node1 ~]# mkdir  /application/mysql/data -p

給/application/mysql/目錄授予mysql用戶和mysql組的權限
[root@node1 ~]# chown -R mysql.mysql  /application/mysql/

初始化數據文件
[root@node1 ~]#/application/mysql/bin/mysql_install_db  --basedir=/application/mysql/ --datadir=/application/mysql/data/ --user=mysql

plication/mysql/data/ --user=mysql
Installing MySQL system tables...
170504  4:34:50 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
OK
Filling help tables...
170504  4:34:50 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/application/mysql//bin/mysqladmin -u root password 'new-password'
/application/mysql//bin/mysqladmin -u root -h node1.com password 'new-password'

Alternatively you can run:
/application/mysql//bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /application/mysql/ ; /application/mysql//bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /application/mysql//mysql-test ; perl mysql-test-run.pl

Please report any problems with the /application/mysql//scripts/mysqlbug script!


現在mysql就已經安裝完成,到data目錄下查看會生成兩個庫:
[root@node1 ~]# ll /application/mysql/data/
總計 8
drwx------ 2 mysql root 4096 05-04 04:34 mysql     系統的庫,
drwx------ 2 mysql root 4096 05-04 04:34 test      測試的庫,建議刪除,不安全。

[root@node1 init.d]# /application/mysql//bin/mysqld_safe &
[1] 17071
[root@node1 init.d]# 170504 04:48:46 mysqld_safe Logging to '/application/mysql5.1.72/data/node1.com.err'.
170504 04:48:47 mysqld_safe Starting mysqld daemon with databases from /application/mysql5.1.72/data

[root@node1 init.d]#
[root@node1 init.d]#
[root@node1 init.d]#
[root@node1 init.d]#
[root@node1 init.d]#
[root@node1 init.d]# netstat -tulnp | grep 3306
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      17179/mysqld        




啟動mysql 以start方式啟動
[root@node1 init.d]# cp /usr/local/tools/mysql-5.1.72/support-files/mysql.server /etc/init.d/mysqld
[root@node1 init.d]# chmod +x /etc/init.d/mysqld

保存之后就可以啟動了。



mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| test               |
+--------------------+
3 rows in set (0.00 sec)

mysql> drop database test;
Query OK, 0 rows affected (0.01 sec)

mysql> show databases;    
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
+--------------------+
2 rows in set (0.00 sec)

mysql> select user,host from mysql.user;
+------+-----------+
| user | host      |
+------+-----------+
| root | 127.0.0.1 |
|      | localhost |
| root | localhost |
|      | node1.com |
| root | node1.com |
+------+-----------+
5 rows in set (0.00 sec)

mysql> drop user ""@localhost
    -> ;
Query OK, 0 rows affected (0.00 sec)

mysql> drop user ""@node1.com
    -> ;
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql>
mysql> select user,host from mysql.user;
+------+-----------+
| user | host      |
+------+-----------+
| root | 127.0.0.1 |
| root | localhost |
| root | node1.com |
+------+-----------+
3 rows in set (0.00 sec)

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

成武县| 蓝田县| 洛扎县| 靖宇县| 郑州市| 灯塔市| 达州市| 金坛市| 尼玛县| 石屏县| 乌审旗| 灌阳县| 香格里拉县| 青川县| 沧州市| 广昌县| 忻城县| 内江市| 祁阳县| 阳朔县| 福州市| 宜春市| 台前县| 农安县| 盘山县| 博乐市| 昭平县| 广丰县| 阿坝| 郁南县| 建德市| 张家口市| 浮山县| 石泉县| 卫辉市| 云林县| 中牟县| 彰化县| 突泉县| 平原县| 昭平县|