2013-08-31 13:16:23 4486 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2013-08-31 13:16:23 4486 [Note] InnoDB: Compressed tables use zlib 1.2.3 2013-08-31 13:16:23 4486 [Note] InnoDB: Using Linux native AIO
2013-08-31 13:16:23 4486 [Note] InnoDB: Not using CPU crc32 instructions 2013-08-31 13:16:23 4486 [Note] InnoDB: Initializing buffer pool, size = 128.0M 2013-08-31 13:16:23 4486 [Note] InnoDB: Completed initialization of buffer pool 2013-08-31 13:16:23 4486 [Note] InnoDB: Highest supported file format is Barracuda. 2013-08-31 13:16:23 4486 [Note] InnoDB: 128 rollback segment(s) are active. 2013-08-31 13:16:23 4486 [Note] InnoDB: Waiting for purge to start
2013-08-31 13:16:23 4486 [Note] InnoDB: 5.6.13 started; log sequence number 1625977
2013-08-31 13:16:24 4486 [Note] Binlog end
2013-08-31 13:16:24 4486 [Note] InnoDB: FTS optimize thread exiting. 2013-08-31 13:16:24 4486 [Note] InnoDB: Starting shutdown...
2013-08-31 13:16:25 4486 [Note] InnoDB: Shutdown completed; log sequence number 1625987
A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER ! You will find that password in '/root/.mysql_secret'. You must change that password on your first connect, no other statement but 'SET PASSWORD' will be accepted. See the manual for the semantics of the 'password expired' flag. Also, the account for the anonymous user has been removed. In addition, you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test database. This is strongly recommended for production servers. See the manual for more instructions.
Please report any problems with the /usr/bin/mysqlbug script! 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 New default config file was created as /usr/my.cnf and will be used by default by the server when you start it. You may edit this file to change server settings [root@dg1 rpm]#
[root@dg1 ~]# rpm -qa|grep -i mysql MySQL-server-5.6.13-1.rhel5
这次安装很顺利地就完成了,之前安装失败的主机和这台ASM单实例主机用的是OEL5.7的系统,所以排除了系统问题,肯定是之前的软件兼容性问题,继续安装client软件 [root@dg1 rpm]# rpm -ivh MySQL-client-5.6.13-1.rhel5.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-client ########################################### [100%]
至此,MYSQL顺利安装完毕! 5.1.3 启动MYSQL [root@dg1 rpm]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
报错了,可以使用下面的命令启动:
service mysql start或/etc/init.d/mysql start或/etc/rc.d/init.d/mysql start [root@dg1 rpm]# service mysql start
Starting MySQL...... [ OK ] [root@dg1 rpm]# 5.1.4 登录MYSQL [root@dg1 rpm]# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) [root@dg1 rpm]#
该错误提示不用密码是无法访问的,注意此时用mysql -u root -p的方式也是无法登录的,因为此时没有正确的root密码,必须先强制修改root密码,解决方法如下: [root@dg1 rpm]# /etc/init.d/mysql stop
Shutting down MySQL.. [ OK ] [root@dg1 rpm]# /usr/bin/mysqld_safe --skip-grant-tables 130831 14:32:39 mysqld_safe Logging to '/var/lib/mysql/dg1.err'.
130831 14:32:39 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
另外再开一个SSH后执行: [root@dg1 ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \\g. Your MySQL connection id is 1
Server version: 5.6.13 MySQL Community Server (GPL)
Copyright (c) 2000, 2013, 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> 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> update user set password=password(\ Query OK, 4 rows affected (0.01 sec) Rows matched: 4 Changed: 4 Warnings: 0 mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec) mysql> exit Bye
直接关闭新开的SSH,或者执行pkill -KILL -t pts/0 可将pts为0的**用户(之前运行mysqld_safe的用户窗口)强制踢出
然后在原来的SSH,执行Ctrl+Z退出skip-grant-tables模式 [1]+ Stopped /usr/bin/mysqld_safe --skip-grant-tables [root@dg1 rpm]#
正常启动 MySQL:/etc/init.d/mysql start (service mysqld start) 此时再使用密码方式登录: [root@dg1 rpm]# mysql -u root -p Enter password:
Welcome to the MySQL monitor. Commands end with ; or \\g. Your MySQL connection id is 5 Server version: 5.6.13
Copyright (c) 2000, 2013, 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>
之后有人提醒我,MYSQL安装完以后默认密码为空,也就是说,如果不进行强制修改密码方式,直接执行#mysql -u root -p也是可以进入系统的,当提示输入密码时直接回车就可以,这个我还没有验证过,如果是真的话,那我就绕圈子了,呵呵 如果已经登陆进系统,想修改某用户的密码,可以执行如下命令: [root@dg1 ~]# /usr/bin/mysqladmin -u root password 123456 5.1.5 操作数据库 mysql> show databases;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
之前已经用安全模式给MYSQL重新修改了密码,也用密码登陆了,但是仍然提示需要密码 查阅官方文档:http://dev.mysql.com/doc/refman/5.6/en/alter-user.html 原来还要重新执行一个操作,再设置一下密码: mysql> set password=password('123456'); Query OK, 0 rows affected (0.03 sec) mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | test | +--------------------+ 4 rows in set (0.00 sec) mysql> use test Database changed mysql> show tables; Empty set (0.00 sec) 5.1.6 设置开机自启动(可选)
可以在/etc/rc.local文件中添加以下MYSQL自启动命令: /etc/init.d/mysql start
另外也可以使用chkconfig命令配置自启动: # chkconfig --list | grep mysql # chkconfig --add mysql
设置完重启系统后,使用netstat-nat命令可以看到MYSQL的3306端口 #netstat-nat|grep 3306 5.1.7 MYSQL几个重要目录说明 (1)数据库目录 /var/lib/mysql/ (2)配置文件
/usr/share/mysql(mysql.server命令及配置文件) (3)相关命令
/usr/bin(mysqladmin mysqldump等命令) (4)启动脚本
/etc/rc.d/init.d/(启动脚本文件mysql的目录)
若想查看MySQL安装到哪个目录,可使用“whereis mysql”命令查看 官方说明:
Table 2.9. MySQL Installation Layout for Linux RPM Packages Directory /usr/bin /usr/sbin /var/lib/mysql
/usr/share/info /usr/share/man /usr/include/mysql /usr/lib/mysql mysql /usr/share/sql-bench
Benchmarks
5.2 源端创建defgen文件并配置
异构数据库之间同步数据必须利用结构转换文件 GGSCI (zlm) 1> edit params defgen defsfile ./dirdef/oratomy.def,purge userid ogg, password ogg table sender.*;
[oracle@zlm gg11] $ ./defgen paramfile ./dirprm/defgen.prm 执行前必须先启动oracle数据库,否则会报:
ERROR OGG-00664 OCI Error beginning session (status = 1034-ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist Linux-x86_64 Error: 2: No such file or directory). ERROR OGG-01668 PROCESS ABENDING. 再执行一次也会报错:
ERROR OGG-00037 DEFSFILE file ./dirdef/oratomy.def already exists. ERROR OGG-01668 PROCESS ABENDING.
此时应该先删除原先的那个def文件,再执行一次,直到出现: Definitions generated for 2 tables in ./dirdef/oratomy.def
这里这条命令的作用就是生成oratomy.def这个异构数据库转换文件
Libraries
mple configuration files, SQL for database installation
/usr/share/Miscellaneous support files, including error messages, character set files, sa
Include (header) files Unix manual pages Manual in Info format Log files, databases Contents of Directory Client programs and scripts The mysqld server