设为首页 收藏本站
查看: 1076|回复: 0

[经验分享] ubuntu 离线包安装mysql-botao

[复制链接]

尚未签到

发表于 2018-10-4 10:44:07 | 显示全部楼层 |阅读模式
1 Preliminary Note
  Because we must run all the steps from this tutorial with root privileges, we can either prepend all commands in this tutorial with the string sudo, or we become root right now by typing
sudo su2 Disabling AppArmor
  Your manually installed MySQL 5.6.8 might refuse to start if AppArmor is running, therefore we disable AppArmor:
/etc/init.d/apparmor stop  
update-rc.d -f apparmor remove
  
apt-get remove apparmor apparmor-utils
3 Installing MySQL 5.6.8rc1 (Linux Generic)
  First we create a user and group called mysql:
groupadd mysql  
useradd -r -g mysql mysql
  Next install the libaio1 package:
apt-get install libaio1  Next:下载和安装
  下载:可以在Oracle 官网下载离线包:我下载的为mysql-5.6.12-linux-glibc2.5-i686.tar.gz
  将离线包复制到 /usr/local下
  Unpack MySQL, rename the directory to mysql, and make it owned by the user and group mysql:
tar xvfz mysql-5.6.12-linux-glibc2.5-i686.tar.gz  
mv mysql-5.6.12-linux-glibc2.5-i686 mysql
  
cd mysql
  
chown -R mysql .
  
chgrp -R mysql .
  Run
scripts/mysql_install_db --user=mysql  在这里可能会出现错误:
  Installing MySQL system tables..../bin/mysqld: error whileloading shared libraries: libaio.so.1: cannot open shared objectfile: No such file or directory
  解决办法:
这说明还要安装一个libaio的依赖库:sudo apt-get install libaio-dev  然后重新执行:
scripts/mysql_install_db --user=mysql  to create the necessary databases (like the mysql database):
  Change some ownerships:
chown -R root .  
chown -R mysql data
  MySQL uses the my.cnf file inside /usr/local/mysql, so we don't have to create one on our own. If you want to change MySQL settings, you can do it in that file.
  The downloaded MySQL package comes with the init script mysql.server which we copy to /etc/init.d as follows:
cp support-files/mysql.server /etc/init.d/mysql.server  It is already executable, so we don't have to change permissions.
  We can now start MySQL 5.6 as follows:
/etc/init.d/mysql.server start  To make MySQL start automatically at boot time, run the following command:
update-rc.d mysql.server defaults
  The MySQL commands (like mysql, mysql_secure_installation, etc.) are located in the /usr/local/mysql/bin directory which is not in the PATH which means we would have to call these commands with the full or>ln -s /usr/local/mysql/bin/* /usr/local/bin/  Finally, we should set a MySQL root password:
mysql_secure_installation  root@server1:/usr/local/mysql# mysql_secure_installation
  启动MySQL服务:                       sudo start mysql
  停止MySQL服务:                       sudo stop mysql
  修改 MySQL 的管理员密码:     sudo mysqladmin -u root password newpassword
  设置远程访问(正常情况下,mysql占用的3306端口只是在IP 127.0.0.1上监听,拒绝了其他IP的访问(通过netstat可以查看到)。取消本地监
  听需要修改 my.cnf 文件:):
  sudo vi /etc/mysql/my.cnf
  bind-address = 127.0.0.1 //找到此内容并且注释
  4)MySQL安装后的目录结构分析(此结构只针对于使用apt-get install 在线安装情况):
  数据库存放目录:              /var/lib/mysql/
  相关配置文件存放目录:          /usr/share/mysql
  相关命令存放目录:             /usr/bin(mysqladmin mysqldump等命令)
  启动脚步存放目录:            /etc/rc.d/init.d/
  5)MySQL图形化管理软件
  一般使用的有两个比较好,一个开源,一个商业收费:
  开源:MySQL Workbench   (具体使用介绍随着我的使用,我会慢慢总结)
  商业:Navicat (收费的,有30天体验,之后我相信大家会有办法的)



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-611775-1-1.html 上篇帖子: MySQL的可视化工具使用 下篇帖子: mysql 批量更新
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表