热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Ubuntu下安装MySQL5.6.23_MySQL

Ubuntu下安装MySQL56231下载对应Linux-generic的源码包,解压,将解压后的文件夹重命名为mysql,移动到usrlocal目录下;tar–xzfmysql-5623-linux-glibc25-x86_64targzmvmysql-5623-li
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权限的密码;
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.搞个符号连接,方便命令的输入;
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
推荐阅读
  • 腾讯安全平台部招聘安全工程师和数据分析工程师
    腾讯安全平台部正在招聘安全工程师和数据分析工程师。安全工程师负责安全问题和安全事件的跟踪和分析,提供安全测试技术支持;数据分析工程师负责安全产品相关系统数据统计和分析挖掘,通过用户行为数据建模为业务决策提供参考。招聘要求包括熟悉渗透测试和常见安全工具原理,精通Web漏洞,熟练使用多门编程语言等。有相关工作经验和在安全站点发表作品的候选人优先考虑。 ... [详细]
  • PHP组合工具以及开发所需的工具
    本文介绍了PHP开发中常用的组合工具和开发所需的工具。对于数据分析软件,包括Excel、hihidata、SPSS、SAS、MARLAB、Eview以及各种BI与报表工具等。同时还介绍了PHP开发所需的PHP MySQL Apache集成环境,包括推荐的AppServ等版本。 ... [详细]
  • systemd-nspawn可以创建最轻量级的容器(ns的意思就是namespace),本文的实验平台是Ubuntu16.04,x86_64机器。本文的目的是:在Ubuntu中用syst ... [详细]
  • 在Docker中,将主机目录挂载到容器中作为volume使用时,常常会遇到文件权限问题。这是因为容器内外的UID不同所导致的。本文介绍了解决这个问题的方法,包括使用gosu和suexec工具以及在Dockerfile中配置volume的权限。通过这些方法,可以避免在使用Docker时出现无写权限的情况。 ... [详细]
  • 学习SLAM的女生,很酷
    本文介绍了学习SLAM的女生的故事,她们选择SLAM作为研究方向,面临各种学习挑战,但坚持不懈,最终获得成功。文章鼓励未来想走科研道路的女生勇敢追求自己的梦想,同时提到了一位正在英国攻读硕士学位的女生与SLAM结缘的经历。 ... [详细]
  • 本文介绍了在开发Android新闻App时,搭建本地服务器的步骤。通过使用XAMPP软件,可以一键式搭建起开发环境,包括Apache、MySQL、PHP、PERL。在本地服务器上新建数据库和表,并设置相应的属性。最后,给出了创建new表的SQL语句。这个教程适合初学者参考。 ... [详细]
  • 本文介绍了在Hibernate配置lazy=false时无法加载数据的问题,通过采用OpenSessionInView模式和修改数据库服务器版本解决了该问题。详细描述了问题的出现和解决过程,包括运行环境和数据库的配置信息。 ... [详细]
  • Metasploit攻击渗透实践
    本文介绍了Metasploit攻击渗透实践的内容和要求,包括主动攻击、针对浏览器和客户端的攻击,以及成功应用辅助模块的实践过程。其中涉及使用Hydra在不知道密码的情况下攻击metsploit2靶机获取密码,以及攻击浏览器中的tomcat服务的具体步骤。同时还讲解了爆破密码的方法和设置攻击目标主机的相关参数。 ... [详细]
  • 本文介绍了高校天文共享平台的开发过程中的思考和规划。该平台旨在为高校学生提供天象预报、科普知识、观测活动、图片分享等功能。文章分析了项目的技术栈选择、网站前端布局、业务流程、数据库结构等方面,并总结了项目存在的问题,如前后端未分离、代码混乱等。作者表示希望通过记录和规划,能够理清思路,进一步完善该平台。 ... [详细]
  • 本文介绍了在Mac上搭建php环境后无法使用localhost连接mysql的问题,并通过将localhost替换为127.0.0.1或本机IP解决了该问题。文章解释了localhost和127.0.0.1的区别,指出了使用socket方式连接导致连接失败的原因。此外,还提供了相关链接供读者深入了解。 ... [详细]
  • 众筹商城与传统商城的区别及php众筹网站的程序源码
    本文介绍了众筹商城与传统商城的区别,包括所售产品和玩法不同以及运营方式不同。同时还提到了php众筹网站的程序源码和方维众筹的安装和环境问题。 ... [详细]
  • 本文介绍了在CentOS上安装Python2.7.2的详细步骤,包括下载、解压、编译和安装等操作。同时提供了一些注意事项,以及测试安装是否成功的方法。 ... [详细]
  • Centos7搭建ELK(Elasticsearch、Logstash、Kibana)教程及注意事项
    本文介绍了在Centos7上搭建ELK(Elasticsearch、Logstash、Kibana)的详细步骤,包括下载安装包、安装Elasticsearch、创建用户、修改配置文件等。同时提供了使用华为镜像站下载安装包的方法,并强调了保证版本一致的重要性。 ... [详细]
  • 本文介绍了在Ubuntu 11.10 x64环境下安装Android开发环境的步骤,并提供了解决常见问题的方法。其中包括安装Eclipse的ADT插件、解决缺少GEF插件的问题以及解决无法找到'userdata.img'文件的问题。此外,还提供了相关插件和系统镜像的下载链接。 ... [详细]
  • Linux下部署Symfoy2对app/cache和app/logs目录的权限设置,symfoy2logs
    php教程|php手册xml文件php教程-php手册Linux下部署Symfoy2对appcache和applogs目录的权限设置,symfoy2logs黑色记事本源码,vsco ... [详细]
author-avatar
杀手也热血_949
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有