Linux下mysql下载安装

一:下载软件

--个人机器为:Redhat 4,32位

下载地址为:http://dev.mysql.com/downloads/mysql/5.0.html,打开此网页,下拉网页找到“Linux -Generic”项

 

找到“Server”和“Client ”项,进行下载

--请选择适合自己机器的,进行下载,这里选择了32位的

 

--需要登录,才能下载。

 

 

二:将软件包上传到Linux里面

点击xmanager的传输按钮(也可以用smb服务或者secure crt软件传输)


 

--左边标红处为windows端软件所在路径,右边为Linux端软件所在路径

[root@target_pc ~]# cd /home/oracle/software

[root@target_pc software]# ls

MySQL-client-5.6.20-1.linux_glibc2.5.i386.rpm  MySQL-server-5.6.20-1.linux_glibc2.5.i386.rpm

 

三:安装mysql

[root@target_pc software]# rpm -ivh MySQL-server-5.6.20-1.linux_glibc2.5.i386.rpm 

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

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

warning: user mysql does not exist - using root

warning: group mysql does not exist - using root

2014-09-18 22:37:05 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2014-09-18 22:37:05 2676 [Note] InnoDB: Using mutexes to ref count buffer pool pages

2014-09-18 22:37:05 2676 [Note] InnoDB: The InnoDB memory heap is disabled

2014-09-18 22:37:05 2676 [Note] InnoDB: Mutexes and rw_locks use InnoDB's own implementation

2014-09-18 22:37:05 2676 [Note] InnoDB: Memory barrier is not used

2014-09-18 22:37:05 2676 [Note] InnoDB: Compressed tables use zlib 1.2.3

2014-09-18 22:37:05 2676 [Note] InnoDB: Using Linux native AIO

2014-09-18 22:37:05 2676 [Note] InnoDB: Not using CPU crc32 instructions

2014-09-18 22:37:05 2676 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2014-09-18 22:37:05 2676 [Note] InnoDB: Completed initialization of buffer pool

2014-09-18 22:37:05 2676 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!

2014-09-18 22:37:05 2676 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB

2014-09-18 22:37:05 2676 [Note] InnoDB: Database physically writes the file full: wait...

2014-09-18 22:37:05 2676 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB

2014-09-18 22:37:05 2676 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB

2014-09-18 22:37:05 2676 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0

2014-09-18 22:37:05 2676 [Warning] InnoDB: New log files created, LSN=45781

2014-09-18 22:37:05 2676 [Note] InnoDB: Doublewrite buffer not found: creating new

2014-09-18 22:37:05 2676 [Note] InnoDB: Doublewrite buffer created

2014-09-18 22:37:05 2676 [Note] InnoDB: 128 rollback segment(s) are active.

2014-09-18 22:37:05 2676 [Warning] InnoDB: Creating foreign key constraint system tables.

2014-09-18 22:37:05 2676 [Note] InnoDB: Foreign key constraint system tables created

2014-09-18 22:37:05 2676 [Note] InnoDB: Creating tablespace and datafile system tables.

2014-09-18 22:37:05 2676 [Note] InnoDB: Tablespace and datafile system tables created.

2014-09-18 22:37:05 2676 [Note] InnoDB: Waiting for purge to start

2014-09-18 22:37:06 2676 [Note] InnoDB: 5.6.20 started; log sequence number 0

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

2014-09-18 22:37:06 2676 [Note] Binlog end

2014-09-18 22:37:06 2676 [Note] InnoDB: FTS optimize thread exiting.

2014-09-18 22:37:06 2676 [Note] InnoDB: Starting shutdown...

2014-09-18 22:37:07 2676 [Note] InnoDB: Shutdown completed; log sequence number 1625977

 

 

2014-09-18 22:37:07 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2014-09-18 22:37:07 2698 [Note] InnoDB: Using mutexes to ref count buffer pool pages

2014-09-18 22:37:07 2698 [Note] InnoDB: The InnoDB memory heap is disabled

2014-09-18 22:37:07 2698 [Note] InnoDB: Mutexes and rw_locks use InnoDB's own implementation

2014-09-18 22:37:07 2698 [Note] InnoDB: Memory barrier is not used

2014-09-18 22:37:07 2698 [Note] InnoDB: Compressed tables use zlib 1.2.3

2014-09-18 22:37:07 2698 [Note] InnoDB: Using Linux native AIO

2014-09-18 22:37:07 2698 [Note] InnoDB: Not using CPU crc32 instructions

2014-09-18 22:37:07 2698 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2014-09-18 22:37:07 2698 [Note] InnoDB: Completed initialization of buffer pool

2014-09-18 22:37:07 2698 [Note] InnoDB: Highest supported file format is Barracuda.

2014-09-18 22:37:07 2698 [Note] InnoDB: 128 rollback segment(s) are active.

2014-09-18 22:37:07 2698 [Note] InnoDB: Waiting for purge to start

2014-09-18 22:37:07 2698 [Note] InnoDB: 5.6.20 started; log sequence number 1625977

2014-09-18 22:37:08 2698 [Note] Binlog end

2014-09-18 22:37:08 2698 [Note] InnoDB: FTS optimize thread exiting.

2014-09-18 22:37:08 2698 [Note] InnoDB: Starting shutdown...

2014-09-18 22:37:09 2698 [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.

 

See the manual for more instructions.

 

Please report any problems at http://bugs.mysql.com/

 

The latest information about MySQL is available on the web at

 

  http://www.mysql.com

 

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

 

[root@target_pc software]# rpm -ivh MySQL-client-5.6.20-1.linux_glibc2.5.i386.rpm 

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

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

 

--通过这种形式安装,mysql用户和用户组会自动建立,并且是mysql安装路径的所属用户和用户组。

四:改root密码

[root@target_pc software]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &

[1] 3119

[root@target_pc software]# 140918 23:02:23 mysqld_safe Logging to '/var/lib/mysql/target_pc.err'.

140918 23:02:23 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql


--它会停留在这个界面一段时间,感觉需要一直等待一样,此时,直接回车就行了。


[root@target_pc software]# mysql -u root -p

Enter password: 

--这里不用输入密码,直接回车就行了。

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

Your MySQL connection id is 1

Server version: 5.6.20 MySQL Community Server (GPL)

 

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> update user set password=password('beijing') where user='root';

Query OK, 4 rows affected (0.01 sec)

Rows matched: 4  Changed: 4  Warnings: 0

 


mysql> FLUSH PRIVILEGES;

Query OK, 0 rows affected (0.00 sec)


mysql> quit

Bye


五:启动mysql服务

[root@target_pc software]# service mysql start

Starting MySQL.                                            [  OK  ]

六:登陆,测试是否安装成功

[root@target_pc software]# mysql -u root -p

Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.20


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> show databases;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement


mysql> set password=password('beijing');
Query OK, 0 rows affected (0.00 sec)

--再设置一次密码


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


--不会再报错了。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值