Chinaunix首页 | 论坛 | 博客
  • 博客访问: 23949
  • 博文数量: 10
  • 博客积分: 56
  • 博客等级: 民兵
  • 技术积分: 75
  • 用 户 组: 普通用户
  • 注册时间: 2009-08-11 14:06
个人简介

尤当晚学,不可自弃

文章分类

全部博文(10)

文章存档

2017年(5)

2016年(2)

2011年(3)

我的朋友

分类: Mysql/postgreSQL

2017-02-09 07:40:25


http://20883340.blog.163.com/blog/static/44854102008101614323119/

[root@localhost gaoxl]# yum search mysql
载入插件: refresh-packagekit
================================ Matched: mysql ================================
libgda-mysql.i386 : MySQL provider for libgda
libgda-mysql-devel.i386 : MySQL provider for libgda pkgconfig file
mod_auth_mysql.i386 : Basic authentication for the Apache web server using a
                    : MySQL database
mysql-connector-java.i386 : Official JDBC driver for MySQL
pam_mysql.i386 : PAM module for auth UNIX users using MySQL data base
qt-mysql.i386 : MySQL driver for Qt's SQL classes
Io-language-mysql.i386 : Io mysql bindings
LinLog.i386 : A ham radio logbook for Linux
MySQL-python.i386 : 一个到 MySQL 的界面
apr-util-mysql.i386 : APR utility library MySQL DBD driver
bacula-director-common.i386 : Common Bacula Director files
bacula-director-mysql.i386 : Bacula Director with MySQL database support
bacula-storage-mysql.i386 : MySQL Bacula storage daemon files
bibus.noarch : Bibliographic and reference management software
bibus.i386 : Bibliographic and reference management software
bugzilla.noarch : Bug tracking system
bytefx-data-mysql.i386 : Mono 的 MySQL 数据库连接性
cacti.noarch : An rrd based graphing tool
callweaver-mysql.i386 : MySQL support for CallWeaver
collectd-mysql.i386 : MySQL module for collectd
dbmail.i386 : The DBMail mail storage system
dbmail-mysql.i386 : The DBMail mail storage system
freeradius-dialupadmin.i386 : Web management for FreeRADIUS
freeradius-dialupadmin-mysql.i386 : MySQL component of the dialupadmin
                                  : FreeRADIUS Web management tool
freeradius-mysql.i386 : MySQL support for freeradius
gallery2.noarch : Customizable photo gallery web site
gnokii-smsd-mysql.i386 : MySQL support for Gnokii SMS daemon
gpsdrive.i386 : A GPS based navigation tool
innotop.noarch : A MySQL and InnoDB monitor program
libdbi-dbd-mysql.i386 : libdbi 的 MySQL 插件
libnss-mysql.i386 : NSS library for MySQL
libpreludedb-mysql.i386 : Plugin to use prelude with a mysql database
lighttpd-mod_mysql_vhost.i386 : Virtual host module for lighttpd that uses a
                              : MySQL database
limph.noarch : A PHP5-compatible network host/service poller with web interface
lua-sql.i386 : Database connectivity for the Lua programming language
lua-sql-mysql.i386 : MySQL database connectivity for the Lua programming
                   : language
mantis.noarch : Web-based bugtracking system
moodss.i386 : Powerful modular monitoring graphical application
moomps.i386 : Powerful modular monitoring service
mysql++.i386 : C++ wrapper for the MySQL C API
mysql++-devel.i386 : MySQL++ developer files (headers, examples, etc.)
mysql++-manuals.i386 : MySQL++ user and reference manuals
mysql.i386 : MySQL 客户端程序和共享库
mysql-administrator.i386 : GUI tools to manage mysql Databases
mysql-bench.i386 : MySQL 标准脚本和数据
mysql-connector-odbc.i386 : MySQL 的 ODBC 驱动程序。
mysql-devel.i386 : Files for development of MySQL applications
mysql-gui-common.i386 : Common data shared among the MySQL GUI Suites
mysql-gui-tools.i386 : GUI tools to manage mysql Databases
mysql-libs.i386 : MySQL 客户端所需的共享库
mysql-proxy.i386 : A proxy for the MySQL Client/Server protocol
mysql-query-browser.i386 : A graphical tool for handling MySQL queries
mysql-server.i386 : MySQL 服务器和相关的文件
mysql-test.i386 : The test suite distributed with MySQL
mysqltuner.noarch : MySQL high performance tuning script
mytop.noarch : A top clone for MySQL
nagios-plugins-mysql.i386 : Nagios Plugin - check_mysql
ocaml-mysql.i386 : OCaml library for accessing MySQL databases
ocaml-mysql-devel.i386 : Development files for ocaml-mysql
openser.i386 : Open Source SIP Server
openser-mysql.i386 : MySQL Storage Support for the OpenSER
pdns-backend-mysql.i386 : MySQL backend for pdns
perl-Class-DBI-mysql.noarch : Extensions to Class::DBI for MySQL
perl-DBD-Mock.noarch : Mock database driver for testing
perl-DBD-MySQL.i386 : perl 的 MySQL 接口
perl-DBIx-DBSchema.noarch : Database-independent schema objects
perl-DateTime-Format-DBI.noarch : Find a parser class for a database connection
perl-DateTime-Format-MySQL.noarch : Parse and format MySQL dates and times
perl-Text-TabularDisplay.noarch : Display text in formatted table output
perl-Time-Piece-MySQL.noarch : MySQL-specific methods for Time::Piece
php-laconica.noarch : PHP tool for microblogging
php-mysql.i386 : 用于使用 MySQL 数据库的 PHP 程序的模块
php-pdo.i386 : A database access abstraction module for PHP applications
php-pear-MDB2-Driver-mysql.noarch : MySQL MDB2 driver
php-pear-MDB2-Driver-mysqli.noarch : MySQL Improved MDB2 driver
phpMyAdmin.noarch : Web based MySQL browser written in php
proftpd-mysql.i386 : Module to add MySQL support to the ProFTPD FTP server
pure-ftpd.i386 : Lightweight, fast and secure FTP server
pyicq-t-mysql.noarch : MySQL backend for ICQ transport
python-openid.noarch : Python OpenID libraries
python-rdflib.i386 : Python library for working with RDF
python-sqlobject.noarch : SQLObject -Object-Relational Manager, aka database
                        : wrapper
python-storm.i386 : An object-relational mapper (ORM) for Python
python-storm-mysql.i386 : MySQL backend for python-storm
qt3-MySQL.i386 : MySQL drivers for Qt 3's SQL classes
rekall.i386 : A KDE database front-end application
rekall-mysql.i386 : Rekall MySQL driver
roundcubemail.noarch : Round Cube Webmail is a browser-based multilingual IMAP
                     : client
rsyslog.i386 : Enhanced system logging and kernel message trapping daemons
rsyslog-mysql.i386 : MySQL support for rsyslog
ruby-mysql.i386 : A Ruby interface to MySQL
rubygem-rails.noarch : Web-application framework
ser-mysql.i386 : MySQL Storage Support for the SIP Express Router
showimg-mysql.i386 : MySQL plugin for the Showimg image database
snort.i386 : Intrusion detection system
snort-bloat.i386 : Snort with Flexible Response
snort-mysql+flexresp.i386 : Snort with Flexible Response
snort-mysql.i386 : Snort with Flexible Response
ulogd-mysql.i386 : MySQL output plugin for ulogd
unixODBC.i386 : A complete ODBC driver manager for Linux
[root@localhost gaoxl]# yum install mysql-server
载入插件: refresh-packagekit
设置安装进程
分析安装参数的语法
解决依赖相关
-->运行处理检查
---> 包 mysql-server.i386 0:5.0.51a-1.fc9 设置为 升级
--> 过程依赖: mysql = 5.0.51a-1.fc9 依赖于包: mysql-server
-->运行处理检查
---> 包 mysql.i386 0:5.0.51a-1.fc9 设置为 升级
--> 完成依赖性检查

依赖性解决

================================================================================
包                    架构           版本                    仓库               大小  
================================================================================
正在安装:
mysql-server         i386         5.0.51a-1.fc9         fedora           9.8 M
为依赖而安装:
mysql                i386         5.0.51a-1.fc9         fedora           2.9 M

Transaction Summary
================================================================================
Install      2 Package(s)        
Update       0 Package(s)        
Remove       0 Package(s)        

总共下载大小: 13 M
确定是这样吗? [y/N]: y
下载软件包:
(1/2): mysql-5.0.51a-1.fc9.i386.rpm                      | 656 kB     27:12    
: [Errno 4] Socket Error: timed out
尝试其他镜像.
(1/2): mysql-5.0.51a-1.fc9.i386.rpm                      | 2.9 MB     03:34    
(2/2): mysql-server-5.0.51a-1.fc9.i386.rpm               | 9.8 MB     15:27    
--------------------------------------------------------------------------------
Total                                           4.6 kB/s | 13 MB     46:39    
运行 rpm_check_debug
运行测试事务处理
传输测试完成
事务处理测试成功
运行事务处理
正在安装           : mysql                                             [1/2]
正在安装           : mysql-server                                      [2/2]

已安装: mysql-server.i386 0:5.0.51a-1.fc9
依赖安装: mysql.i386 0:5.0.51a-1.fc9
恭喜你!成功完成!
[root@localhost gaoxl]# mysql-server
-bash: mysql-server: command not found
[root@localhost gaoxl]# mysqld
-bash: mysqld: command not found
[root@localhost gaoxl]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@localhost gaoxl]# mysqladmin
mysqladmin Ver 8.41 Distrib 5.0.51a, for redhat-linux-gnu on i386
Copyright (C) 2000-2006 MySQL AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Administration program for the mysqld daemon.
Usage: mysqladmin [OPTIONS] command command....
-c, --count=#       Number of iterations to make. This works with -i
                      (--sleep) only.
-#, --debug[=name] Output debug log. Often this is 'd:t:o,filename'.
-f, --force         Don't ask for confirmation on drop database; with
                      multiple commands, continue even if an error occurs.
-C, --compress      Use compression in server/client protocol.
--character-sets-dir=name
                      Directory where character sets are.
--default-character-set=name
                      Set the default character set.
-?, --help          Display this help and exit.
-h, --host=name     Connect to host.
-p, --password[=name]
                      Password to use when connecting to server. If password is
                      not given it's asked from the tty.
-P, --port=#        Port number to use for connection.
--protocol=name     The protocol of connection (tcp,socket,pipe,memory).
-r, --relative      Show difference between current and previous values when
                      used with -i. Currently works only with extended-status.
-O, --set-variable=name
                      Change the value of a variable. Please note that this
                      option is deprecated; you can set variables directly with
                      --variable-name=value.
-s, --silent        Silently exit if one can't connect to server.
-S, --socket=name   Socket file to use for connection.
-i, --sleep=#       Execute commands again and again with a sleep between.
--ssl               Enable SSL for connection (automatically enabled with
                      other flags). Disable with --skip-ssl.
--ssl-ca=name       CA file in PEM format (check OpenSSL docs, implies
                      --ssl).
--ssl-capath=name   CA directory (check OpenSSL docs, implies --ssl).
--ssl-cert=name     X509 cert in PEM format (implies --ssl).
--ssl-cipher=name   SSL cipher to use (implies --ssl).
--ssl-key=name      X509 key in PEM format (implies --ssl).
--ssl-verify-server-cert
                      Verify server's "Common Name" in its cert against
                      hostname used when connecting. This option is disabled by
                      default.
-u, --user=name     User for login if not current user.
-v, --verbose       Write more information.
-V, --version       Output version information and exit.
-E, --vertical      Print output vertically. Is similar to --relative, but
                      prints output vertically.
-w, --wait[=#]      Wait and retry if connection is down.
--connect_timeout=#
--shutdown_timeout=#

Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
--------------------------------- -----------------------------
count                             0
force                             FALSE
compress                          FALSE
character-sets-dir                (No default value)
default-character-set             (No default value)
host                              (No default value)
port                              0
relative                          FALSE
socket                            (No default value)
sleep                             0
ssl                               FALSE
ssl-ca                            (No default value)
ssl-capath                        (No default value)
ssl-cert                          (No default value)
ssl-cipher                        (No default value)
ssl-key                           (No default value)
ssl-verify-server-cert            FALSE
user                              (No default value)
verbose                           FALSE
vertical                          FALSE
connect_timeout                   43200
shutdown_timeout                  3600

Default options are read from the following files in the given order:
/etc/my.cnf ~/.my.cnf /etc/my.cnf
The following groups are read: mysqladmin client
The following options may be given as the first argument:
--print-defaults        Print the program argument list and exit
--no-defaults           Don't read default options from any options file
--defaults-file=#       Only read default options from the given file #
--defaults-extra-file=# Read this file after the global files are read

Where command is a one or more of: (Commands may be shortened)
create databasename   Create a new database
debug                 Instruct server to write debug information to log
drop databasename     Delete a database and all its tables
extended-status       Gives an extended status message from the server
flush-hosts           Flush all cached hosts
flush-logs            Flush all logs
flush-status          Clear status variables
flush-tables          Flush all tables
flush-threads         Flush the thread cache
flush-privileges      Reload grant tables (same as reload)
kill id,id,...        Kill mysql threads
password new-password Change old password to new-password, MySQL 4.1 hashing.
old-password new-password Change old password to new-password in old format.

ping                  Check if mysqld is alive
processlist           Show list of active threads in server
reload                Reload grant tables
refresh               Flush all tables and close and open logfiles
shutdown              Take server down
status                Gives a short status message from the server
start-slave           Start slave
stop-slave            Stop slave
variables             Prints variables available
version               Get version info from server
[root@localhost gaoxl]# mysqladmin start
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
[root@localhost gaoxl]# mysqld
-bash: mysqld: command not found
[root@localhost gaoxl]# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@localhost gaoxl]#
[root@localhost gaoxl]# service mysqld start
初始化 MySQL 数据库: Installing MySQL system tables...
ERROR: 1062 Duplicate entry 'localhost-' for key 1
081116 11:52:03 [ERROR] Aborting

081116 11:52:03 [Note] /usr/libexec/mysqld: Shutdown complete

Installation of system tables failed!

Examine the logs in /var/lib/mysql for more information.
You can try to start the mysqld daemon with:
/usr/libexec/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> /usr/bin/mysql -u root mysql
mysql> 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.

The latest information about MySQL is available on the web at

Please consult the MySQL manual section: 'Problems running mysql_install_db',
and the manual section that describes problems on your OS.
Another information source is the MySQL email archive.
Please check all of the above before mailing us!
And if you do mail us, you MUST use the /usr/bin/mysqlbug script!
[失败]

[root@localhost gaoxl]# cd /var/lib/mysql

[root@localhost mysql]# ls -l
总计 8
drwx------ 2 mysql mysql 4096 11-16 11:52 mysql
drwx------ 2 mysql mysql 4096 11-16 11:52 test

[root@localhost mysql]# cd mysql

[root@localhost mysql]# ls
columns_priv.frm   help_relation.MYI time_zone_leap_second.frm
columns_priv.MYD   help_topic.frm     time_zone_leap_second.MYD
columns_priv.MYI   help_topic.MYD     time_zone_leap_second.MYI
db.frm             help_topic.MYI     time_zone.MYD
db.MYD             host.frm           time_zone.MYI
db.MYI             host.MYD           time_zone_name.frm
func.frm           host.MYI           time_zone_name.MYD
func.MYD           proc.frm           time_zone_name.MYI
func.MYI           proc.MYD           time_zone_transition.frm
help_category.frm proc.MYI           time_zone_transition.MYD
help_category.MYD procs_priv.frm     time_zone_transition.MYI
help_category.MYI procs_priv.MYD     time_zone_transition_type.frm
help_keyword.frm   procs_priv.MYI     time_zone_transition_type.MYD
help_keyword.MYD   tables_priv.frm    time_zone_transition_type.MYI
help_keyword.MYI   tables_priv.MYD    user.frm
help_relation.frm tables_priv.MYI    user.MYD
help_relation.MYD time_zone.frm      user.MYI

[root@localhost mysql]# /usr/libexec/mysqld --skip-grant &
[1] 18540
[root@localhost mysql]# InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
081116 11:54:57 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
081116 11:54:57 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
081116 11:54:57 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
081116 11:54:58 InnoDB: Started; log sequence number 0 0
081116 11:54:58 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.0.51a' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

[root@localhost mysql]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.51a Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show tables
    -> ;
ERROR 1046 (3D000): No database selected
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| test               |
+--------------------+
3 rows in set (0.02 sec)

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> show tables
    -> ;
+---------------------------+
| Tables_in_mysql           |
+---------------------------+
| columns_priv              |
| db                        |
| func                      |
| help_category             |
| help_keyword              |
| help_relation             |
| help_topic                |
| host                      |
| proc                      |
| procs_priv                |
| tables_priv               |
| time_zone                 |
| time_zone_leap_second     |
| time_zone_name            |
| time_zone_transition      |
| time_zone_transition_type |
| user                      |
+---------------------------+
17 rows in set (0.00 sec)

mysql>

阅读(5238) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~