Ubuntu下安装MySQL 5.6.23

时间:2022-10-01 08:32:36

Ubuntu下安装MySQL 5.6.23

1.下载相应Linux-generic的源代码包。解压,将解压后的文件夹重命名为mysql。移动到/usr/local文件夹下;
tar –xzf mysql-5.6.23-linux-glibc2.5-x86_64.tar.gz
mv mysql-5.6.23-linux-glibc2.5-x86_64 mysql
 sudo mv mysql /usr/local

2.创建用户mysql和组mysql
vonzhou@de16-C6100: sudo groupadd mysql

vonzhou@de16-C6100:  sudo useradd -r -g mysql mysql

3、进入mysql文件夹
vonzhou@de16-C6100:  sudo cd /usr/local/mysql 

4、将mysql目录own及grp变更为mysql
vonzhou@de16-C6100:/usr/local/mysql$ sudo chown -R mysql .
vonzhou@de16-C6100:/usr/local/mysql$ sudo chgrp -R mysql .



5、运行mysql安装脚本,设置用户

vonzhou@de16-C6100:/usr/local/mysql$ sudo ./scripts/mysql_install_db --user=mysql

Installing MySQL system tables..../bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
vonzhou@de16-C6100:/usr/local/mysql$ sudo apt-get install libaio-dev

(..........)

vonzhou@de16-C6100:/usr/local/mysql$ sudo ./scripts/mysql_install_db --user=mysql

Installing MySQL system tables...2015-03-18 21:22:46 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2015-03-18 21:22:46 5284 [Note] InnoDB: Using atomics to ref count buffer pool pages

2015-03-18 21:22:46 5284 [Note] InnoDB: The InnoDB memory heap is disabled

2015-03-18 21:22:46 5284 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2015-03-18 21:22:46 5284 [Note] InnoDB: Memory barrier is not used

2015-03-18 21:22:46 5284 [Note] InnoDB: Compressed tables use zlib 1.2.3

2015-03-18 21:22:46 5284 [Note] InnoDB: Using Linux native AIO

2015-03-18 21:22:46 5284 [Note] InnoDB: Using CPU crc32 instructions

2015-03-18 21:22:46 5284 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2015-03-18 21:22:46 5284 [Note] InnoDB: Completed initialization of buffer pool

2015-03-18 21:22:46 5284 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!

2015-03-18 21:22:46 5284 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB

2015-03-18 21:22:46 5284 [Note] InnoDB: Database physically writes the file full: wait...

2015-03-18 21:22:46 5284 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB

2015-03-18 21:22:46 5284 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB

2015-03-18 21:22:47 5284 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0

2015-03-18 21:22:47 5284 [Warning] InnoDB: New log files created, LSN=45781

2015-03-18 21:22:47 5284 [Note] InnoDB: Doublewrite buffer not found: creating new

2015-03-18 21:22:47 5284 [Note] InnoDB: Doublewrite buffer created

2015-03-18 21:22:47 5284 [Note] InnoDB: 128 rollback segment(s) are active.

2015-03-18 21:22:47 5284 [Warning] InnoDB: Creating foreign key constraint system tables.

2015-03-18 21:22:47 5284 [Note] InnoDB: Foreign key constraint system tables created

2015-03-18 21:22:47 5284 [Note] InnoDB: Creating tablespace and datafile system tables.

2015-03-18 21:22:47 5284 [Note] InnoDB: Tablespace and datafile system tables created.

2015-03-18 21:22:47 5284 [Note] InnoDB: Waiting for purge to start

2015-03-18 21:22:48 5284 [Note] InnoDB: 5.6.23 started; log sequence number 0

2015-03-18 21:22:52 5284 [Note] Binlog end

2015-03-18 21:22:52 5284 [Note] InnoDB: FTS optimize thread exiting.

2015-03-18 21:22:52 5284 [Note] InnoDB: Starting shutdown...

2015-03-18 21:22:53 5284 [Note] InnoDB: Shutdown completed; log sequence number 1625977

OK



Filling help tables...2015-03-18 21:22:53 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2015-03-18 21:22:53 5307 [Note] InnoDB: Using atomics to ref count buffer pool pages

2015-03-18 21:22:53 5307 [Note] InnoDB: The InnoDB memory heap is disabled

2015-03-18 21:22:53 5307 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2015-03-18 21:22:53 5307 [Note] InnoDB: Memory barrier is not used

2015-03-18 21:22:53 5307 [Note] InnoDB: Compressed tables use zlib 1.2.3

2015-03-18 21:22:53 5307 [Note] InnoDB: Using Linux native AIO

2015-03-18 21:22:53 5307 [Note] InnoDB: Using CPU crc32 instructions

2015-03-18 21:22:53 5307 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2015-03-18 21:22:53 5307 [Note] InnoDB: Completed initialization of buffer pool

2015-03-18 21:22:53 5307 [Note] InnoDB: Highest supported file format is Barracuda.

2015-03-18 21:22:53 5307 [Note] InnoDB: 128 rollback segment(s) are active.

2015-03-18 21:22:53 5307 [Note] InnoDB: Waiting for purge to start

2015-03-18 21:22:53 5307 [Note] InnoDB: 5.6.23 started; log sequence number 1625977

2015-03-18 21:22:53 5307 [Note] Binlog end

2015-03-18 21:22:53 5307 [Note] InnoDB: FTS optimize thread exiting.

2015-03-18 21:22:53 5307 [Note] InnoDB: Starting shutdown...

2015-03-18 21:22:55 5307 [Note] InnoDB: Shutdown completed; log sequence number 1625987

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:



  ./bin/mysqladmin -u root password 'new-password'

  ./bin/mysqladmin -u root -h de16-C6100 password 'new-password'



Alternatively you can run:



  ./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 . ; ./bin/mysqld_safe &



You can test the MySQL daemon with mysql-test-run.pl



  cd mysql-test ; perl mysql-test-run.pl



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



WARNING: Found existing config file ./my.cnf on the system.

Because this file might be in use, it was not replaced,

but was used in bootstrap (unless you used --defaults-file)

and when you later start the server.

The new default config file was created as ./my-new.cnf,

please compare it with your file and take the changes you need.
 
6.上述步骤安装完毕后。把该文件夹的全部权变更回来,除了data文件夹能够供我们普通用户操作。
vonzhou@de16-C6100:/usr/local/mysql$ sudo chown -R root .

vonzhou@de16-C6100:/usr/local/mysql$ sudo chown -R mysql data

7. 能够改变默认配置文件的位置;
vonzhou@de16-C6100:/usr/local/mysql$ sudo cp support-files/my-default.cnf /etc/my.cnf

8.后台启动mysql server;

vonzhou@de16-C6100:/usr/local/mysql$ sudo bin/mysqld_safe --user=mysql &

[1] 5375

vonzhou@de16-C6100:/usr/local/mysql$ 150318 21:29:24 mysqld_safe Logging to '/usr/local/mysql/data/de16-C6100.err'.

150318 21:29:24 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data



9. 设置MySQL root权限的password;

vonzhou@de16-C6100:/usr/local/mysql$ sudo bin/mysqladmin -u root password '你的密码'

Warning: Using a password on the command line interface can be insecure.

10. 把运行脚本移到init.d文件夹下;

vonzhou@de16-C6100:/usr/local/mysql$ sudo cp support-files/mysql.server /etc/init.d/mysql.server

11.此时能够查看执行状态。能够用service命令的status/start/stop/restart控制。

vonzhou@de16-C6100:/usr/local/mysql$ sudo service mysql.server status

* MySQL running (5477)

12.设置开机启动(就是插入到那些开机会自己主动执行的脚本中),取消自启动的话defaults -> remove ;

vonzhou@de16-C6100:/usr/local/mysql$ sudo update-rc.d mysql.server defaults

Adding system startup for /etc/init.d/mysql.server ...

   /etc/rc0.d/K20mysql.server -> ../init.d/mysql.server

   /etc/rc1.d/K20mysql.server -> ../init.d/mysql.server

   /etc/rc6.d/K20mysql.server -> ../init.d/mysql.server

   /etc/rc2.d/S20mysql.server -> ../init.d/mysql.server

   /etc/rc3.d/S20mysql.server -> ../init.d/mysql.server

   /etc/rc4.d/S20mysql.server -> ../init.d/mysql.server

   /etc/rc5.d/S20mysql.server -> ../init.d/mysql.server

13.搞个符号连接,方便命令的输入(这个有用程序是用来连接到MySQL server的client程序(CLI));

vonzhou@de16-C6100:/usr/local/mysql$ sudo ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql

14. 此时,就依照好了。能够简单測试下。
vonzhou@de16-C6100:/usr/local/mysql$ mysql

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

Your MySQL connection id is 2

Server version: 5.6.23 MySQL Community Server (GPL)



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

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

| Database           |

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

| information_schema |

| test               |

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

2 rows in set (0.00 sec)



mysql> exit

Bye

Ubuntu下安装MySQL 5.6.23的更多相关文章

  1. Ubuntu 下安装 Mysql

    这里讲用Ubuntu下安装MySql ubuntu上安装mysql非常简单只需要几条命令就可以完成. 1. sudo apt-get install mysql-server   2. apt-get ...

  2. Ubuntu下安装mysql与mysql workbench

    Ubuntu 安装jdk:[链接] Ubuntu安装eclipse:[链接] Ubuntu下安装MySQL与mysql workbench:[链接] Ubuntu配置tomcat9:[链接] 1.su ...

  3. ubuntu下安装mysql和配置远程访问

    ubuntu下安装mysql和配置远程访问   下载安装mysql sudo apt-get install mysql-client mysql-server 安装的时候会提示要设置root密码,如 ...

  4. ubuntu下安装mysql

    现在的软件越来越好安装,尤其是在ubuntu下安装软件,更是没有技巧,只需要在联网的情况下使用apt-get inatll 即可.在决定安装mysql之前,要先确定系统是否已经安装mysql.如下图: ...

  5. (抓)ubuntu下安装mysql --- 我主要参考的文章

    转:http://cycnet.blog.51cto.com/117809/812625 现在的软件越来越好安装,尤其是在ubuntu下安装软件,更是没有技巧,只需要在联网的情况下使用apt-get ...

  6. ubuntu 下安装mysql,以及配置远程登录

    安装MysQL 在Ubuntu14.04下安装MySQL比较简单,只需下面这条命令就行了: 1.输入 sudo apt-get install mysql-server 2.继续执行后,需要设定MyS ...

  7. Ubuntu下安装MySQL及简单操作

    Ubuntu上安装MySQL非常简单只需要几条命令就可以完成. 1. sudo apt-get install mysql-server 2. apt-get isntall mysql-client ...

  8. Ubuntu 下安装mysql

    本文引用自 https://www.cnblogs.com/jpfss/p/7944622.html 此篇为http://www.cnblogs.com/EasonJim/p/7139275.html ...

  9. ubuntu下安装mysql及卸载mysql方法

    1. 删除mysql a. sudo apt-get autoremove --purge mysql-server-5.0 b. sudo apt-get remove mysql-server c ...

随机推荐

  1. 关于C++默认初始化的总结——开个坑

    关于C++初始化总结的博客,其实以前在我的独立博客上写过相关的内容,可惜呀,没有续费,腾讯回收了我的空间, 到现在,关于C++初始化的内容,一直是我的心头病,现在准备开个坑,慢慢的总结进来吧. 1.关 ...

  2. UWP 颜色选择器(ColorPicker) 和 自定义的Flyout(AdvancedFlyout)

    ColorPicker 故事背景 项目里面需要一个像Winfrom里面那样的颜色选择器,如下图所示: 在网上看了一下.没有现成的东东可以拿来使用.大概查看了一下关于颜色的一些知识,想着没人种树,那就由 ...

  3. junit入门

    一.简介JUnitJUnit是一个开源的java单元测试框架.在1997年,由 Erich Gamma 和 Kent Beck 开发完成.这两个牛人中 Erich Gamma 是 GOF 之一:Ken ...

  4. linux文件远程传输客户端shell脚本与分布式客户机时间同步脚本

    #!/bin/bash # 将代码和脚本传送至worker节点 # 改变当前工作目录 cd ${AMAZONCRAWLER_HOME} #读取worker节点ip列表 i= while read li ...

  5. Regsvr32注册ActiveX控件

    命令:Regsvr32 XX.dll 注册ActiveX控件 Regsvr32命令参数:/u 卸载ActiveX控件/s 注册成功后不显示操作成功信息框/c 控制台输出/I 调用DllInstall安 ...

  6. Cocos2d-x3.1 粒子效果演示样例

    这里把粒子的几种效果粘出来,以便以后使用 原文地址:http://blog.csdn.net/qqmcy/article/details/37511259 // // IntervalLayer.cp ...

  7. Phalanx

    Phalanx Time Limit:5000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Stat ...

  8. Android动态加载入坑指南

    曾几何时,国内各大公司掀起了一股研究Android动态加载的技术,两年多过去了,动态加载技术俨然成了Android开发中必须掌握的技术.那么动态加载技术是什么呢,这里谈谈我的个人看法,如有雷同,纯属偶 ...

  9. django面试三

    1.Django. Flask.Tornado框架的比较? Django: 对于django,大而全的框架它的内部组件比较多,内部提供:ORM.Admin.中间件.Form.ModelForm.Ses ...

  10. Js分支结构 switch--case

    switch...case...多条分支,根据条件判断,选择执行 语法: switch(表达式){ case 表达式1: 代码段1; break; case 表达式n: 代码段n; break; de ...