当前位置:Gxlcms > 数据库问题 > 源码安装mysql

源码安装mysql

时间:2021-07-01 10:21:17 帮助过:30人阅读

] ‘--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)

源码安装mysql

标签:源码安装mysql

人气教程排行