当前位置: 首页 > news >正文

第一章 MySql的安装 1.1

第一章 MySql的安装 

前言:没有MySqlMySqlDBA也无从入手,工欲善其事,必先利其器!

1、查看系统

uname -a

 Linux tech80192 2.6.26-1-686 #1 SMP Sat Jan 10 18:29:31 UTC 2009 i686 GNU/Linux

file /sbin/init

/sbin/init: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, stripped

 

足以证明,此机器为32位系统!

2、最简单安装

sudo apt-get install mysql-server

helloword:~# sudo apt-get install mysql-server

Reading package lists... Done

........中间省略                                                        

Fetched 46.4MB in 27s (1660kB/s)                                                                                                  

Preconfiguring packages ...

安装过程会让你输入root密码

登陆命令:

mysql -h127.0.0.1 -uroot -phello

-h:表示host

-u:表示用于

-p:表示密码

 

3、源码安装

到官方网站:http://dev.mysql.com/downloads/mysql/#downloads

如图所示:本实例下载了最后一个

 

   wps_clip_image-24690

 

下载源码包

wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.50.tar.gz/from/http://gd.tuwien.ac.at/db/mysql/

 

默认保存为:mysql-5.1.50.tar.gz

下载完毕,tar -zxvf mysql-5.1.50.tar.gz命令解压到当前目录

cd tar -zxvf mysql-5.1.50

创建mysql组,建立mysql用户并加入到mysql组中

groupadd mysql

useradd -g mysql mysql

 

mysql安装

tar -zxvf mysql-5.1.50.tar.gz
tech80192:/home/download# cd mysql-5.1.50
tech80192:/home/download/mysql-5.1.50#
tech80192:/home/download/mysql-5.1.50# ./configure --prefix=/home/mysql
........中间省略   

遇到第一个错误:
/bin/rm: cannot remove `libtoolT': No such file or directory
config.status: executing default commands

tech80192:/home/download/mysql-5.1.50# ./libtool --version
ltmain.sh (GNU libtool) 2.2.6
Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996

Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

网上搜索 一些,
官方解决办法:http://bugs.mysql.com/bug.php?id=47411
需要安装几个包

之后执行
# autoreconf --force --install
# libtoolize --automake --force
# automake --force --add-missing

再执行
# ./configure --prefix=/home/mysql
执 行完发现,还是报同样的错误
网上也找到一些答案http://bugs.debian.org/cgi-bin /bugreport.cgi?bug=523750
还好有一招狠的:
configure 中的 文件更改:
$RM "$cfgfile"
改为:       
$RM -f "$cfgfile"
最见效,至于为什么,好好去想想 吧,O(∩_∩)O~

ok,我们继续吧:
./configure --prefix=/home/mysql
make
make install
终于安装成功啦!

启 动mysql
tech80192:/home/mysql# /home/mysql/bin/mysqld_safe --user=mysql &
[1] 31212
tech80192:/home/mysql# 100826 20:46:10 mysqld_safe Logging to '/var/lib/mysql/tech80192.err'.
100826 20:46:10 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
100826 20:46:10 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
又报错,查看:
cat /var/lib/mysql/tech80192.err
100826 20:46:10 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
100826 20:46:10 [ERROR] Error message file '/usr/share/mysql/english/errmsg.sys' had only 475 error messages,
but it should contain at least 641 error messages.
Check that the above file is the right version for this program!
/home/mysql/libexec/mysqld: Unknown error 1146
100826 20:46:10 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
100826 20:46:10 [ERROR] /home/mysql/libexec/mysqld: unknown option '--skip-bdb'
100826 20:46:10 [ERROR] Aborting

100826 20:46:10 [Note]
100826 20:46:10 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

发现两个错误:
1/usr/share/mysql/english/errmsg.sys

找 到:/home/mysql/share/mysql/english/errmsg.sys
做个软连接吧,
ln -s /home/mysql/share/mysql/english/errmsg.sys /usr/share/mysql/english/errmsg.sys

2unknown option '--skip-bdb'
找到:
# Using BerkeleyDB is now discouraged as its support will cease in 5.1.12.
#skip-bdb
注释掉

再启动试试,又报错
100826 20:52:43 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
/home/mysql/libexec/mysqld: Table 'mysql.plugin' doesn't exist
100826 20:52:43 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
100826 20:52:43 [ERROR] Can't start server : Bind on unix socket: Permission denied
100826 20:52:43 [ERROR] Do you already have another mysqld server running on socket: /var/run/mysqld/mysqld.sock ?
100826 20:52:43 [ERROR] Aborting

100826 20:52:43 [Note] /home/mysql/libexec/mysqld: Shutdown complete

100826 20:52:43 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

想起来了,,重要的东西没有初始化!

创 建mysql许可表:
/home/mysql/bin/mysql_install_db --user=mysql
tech80192:/home/mysql# /home/mysql/bin/mysql_install_db --user=mysql
Installing MySQL system tables...
100826 20:59:42 [Warning] /usr/sbin/mysqld: unknown option '--loose-skip-innodb'

100826 20:59:42 [Warning] /usr/sbin/mysqld: unknown option '--loose-skip-ndbcluster'

100826 20:59:42  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.

Installation of system tables failed!  Examine the logs in
/var/lib/mysql for more information.

You can try to start the mysqld daemon with:

    shell&gt; /usr/sbin/mysqld --skip-grant &

and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:

    shell&gt; /usr/bin/mysql -u root mysql
    mysql&gt; show tables

Try 'mysqld --help' if you have problems with paths.  Using --log
gives you a log in /var/lib/mysql that may be helpful.

Please consult the MySQL manual section
'Problems running mysql_install_db', and the manual section that
describes problems on your OS.  Another information source are the
MySQL email archives available at http://lists.mysql.com/.

Please check all of the above before mailing us!  And remember, if
you do mail us, you MUST use the /usr/scripts/mysqlbug script!

………未完待续。。。。。。。

 

 

相关文章:

  • Android零基础入门第61节:滚动视图ScrollView
  • 我的宽带路
  • ArrayBlockingQueue与LinkedBlockingQueue
  • 一些鲜为人知的编程事实之感想
  • GreenDao3.0新特性解析(配置、注解、加密)
  • oracle与mysql的between and
  • 自定义圆角头像图片
  • nbu6.5 for Solaris安装及备份手册
  • 正式英语和非正式英语
  • spring 使用注解注入 list 或 map
  • 使用ADO.NET2.0提升数据交互性能 DataSet 数据表
  • 99%运维人都需要的Linux命令大全
  • 群发邮件功能的完善
  • VHDL——4层电梯系统设计
  • sql注入——避开过滤
  • ----------
  • [译]CSS 居中(Center)方法大合集
  • 【402天】跃迁之路——程序员高效学习方法论探索系列(实验阶段159-2018.03.14)...
  • Apache Zeppelin在Apache Trafodion上的可视化
  •  D - 粉碎叛乱F - 其他起义
  • java中具有继承关系的类及其对象初始化顺序
  • laravel 用artisan创建自己的模板
  • Laravel核心解读--Facades
  • Lucene解析 - 基本概念
  • macOS 中 shell 创建文件夹及文件并 VS Code 打开
  • PAT A1050
  • SpiderData 2019年2月13日 DApp数据排行榜
  • 分享一个自己写的基于canvas的原生js图片爆炸插件
  • 和 || 运算
  • 前端代码风格自动化系列(二)之Commitlint
  • 跳前端坑前,先看看这个!!
  • 无服务器化是企业 IT 架构的未来吗?
  • 小而合理的前端理论:rscss和rsjs
  • 一加3T解锁OEM、刷入TWRP、第三方ROM以及ROOT
  • 在Unity中实现一个简单的消息管理器
  • 正则学习笔记
  • 湖北分布式智能数据采集方法有哪些?
  • ​TypeScript都不会用,也敢说会前端?
  • ​学习一下,什么是预包装食品?​
  • ​用户画像从0到100的构建思路
  • #13 yum、编译安装与sed命令的使用
  • #include到底该写在哪
  • #ubuntu# #git# repository git config --global --add safe.directory
  • (16)UiBot:智能化软件机器人(以头歌抓取课程数据为例)
  • (3)Dubbo启动时qos-server can not bind localhost22222错误解决
  • (转)创业家杂志:UCWEB天使第一步
  • * 论文笔记 【Wide Deep Learning for Recommender Systems】
  • ***利用Ms05002溢出找“肉鸡
  • .NET HttpWebRequest、WebClient、HttpClient
  • .net 按比例显示图片的缩略图
  • .NET/C# 解压 Zip 文件时出现异常:System.IO.InvalidDataException: 找不到中央目录结尾记录。
  • .Net调用Java编写的WebServices返回值为Null的解决方法(SoapUI工具测试有返回值)
  • .NET框架
  • .NET中GET与SET的用法
  • .Net中wcf服务生成及调用