Showing posts with label MySQL. Show all posts
Showing posts with label MySQL. Show all posts

Friday, September 23, 2016

Migrate MyISAM tables to INNODB using mysqldump


In this article you will find information how to convert MyISAM tables to INNODB. 
The procedure here is an offline procedure, i.e, you cannot have changes on the SOURCE database, while you do this. A better way could be to setup replication between the SOURCE and the TARGET, but that is not described here.

On the source database

In this example we dump out the database mydb into mydb_schema.sql and mydb_data.sql
mysqldump -uroot -p --no-data  -R --triggers mydb > mydb_schema.sql
Then dump out the data:
mysqldump -uroot -p --no-create-info  -R --triggers mydb > mydb_data.sql

Change Storage Engine

You must verify first you don't have any MYISAM tables with FULLTEXT, since innodb only supports FULLTEXT from MySQL version 5.6.
If you have FULLTEXT indexes, then change manually all but the full text tables to innodb (not shown here).
sed -i.bak 's#MyISAM#innodb#g' mydb_schema.sql

On the TARGET database server

Create the database on the target database server and load in the dump into the database mydb:
# create the database
mysql -uroot -p -e "create database mydb" 
# create the schema
mysql -uroot -p mydb < mydb_schema.sql 
# load in the data
mysql -uroot -p mydb < mydb_data.sql

Monday, May 9, 2016

Installation Mysql, php, apache

My environment:



OS
Red Hat Enterprise Linux Server release 6.5 (Santiago)
MySQL
Version 5.1.73-community MySQL Community Server (GPL)
PHP
PHP 5.6.10 (cli)
Htdoc Directory
/u01/qlts/public_html
Apache Configuration Directory
/etc/httpd/conf

MySQL installation

Detail you can read it:

Step 1: Download MySQL
You access the internet via address:

Step 2: Extracting downloaded file to your installing directory:
[root@VTGDB.COM mysql]# tar -xvpf MySQL-community-5.1.73-1.rhel5.x86_64.rpm-bundle.tar 

Step 3: Install MySQL client-server:
[root@VTGDB.COM mysql]# rpm -ivh MySQL-server-community-5.1.73-1.rhel5.x86_64.rpm MySQL-client-community-5.1.73-1.rhel5.x86_64.rpm

Step 4: Install the “Header and Libraries” that are part of the MySQL-devel packages.
[root@VTGDB.COM mysql]# rpm -ivh MySQL-devel-community-5.1.73-1.rhel5.x86_64.rpm

Step 5: Change password for root
[root@VTGDB.COM mysql]# /usr/bin/mysqladmin -u root password '***********'

Step 6: Edit the MySQL Server configuration file:
[root@VTGDB.COM etc]# vi /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
port=3306
user=mysql

#UTF 8 Setting
collation_server=utf8_unicode_ci
character_set_server=utf8
skip-character-set-client-handshake

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

[mysqld_safe]
log-error=/u01/mysql/log/mysqld.log
pid-file=/u01/mysql/mysqld/mysqld.pid
[client]
port=3306

Step 7: Restart MySQL Server
[root@VTGDB.COM etc]# service mysql restart

Shutting down MySQL... [ OK ]

Starting MySQL. [ OK ]


Step 8: Login your new MySQL Server
[root@VTGDB.COM ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 604
Server version: 5.1.73-community 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>

Php Installation


Step 1: Download Php
You access the internet via address:

Step 2: Extract downloaded file to your installing directory:
[root@VTGDB.COM setup]# tar -xzvf php-5.6.10.tar.gz

Step 3: Run installation file
[root@VTGDB.COM setup]# cd php-5.6.10
[root@VTGDB.COM php-5.6.10]# ./configure  --with-apxs2=/usr/sbin/apxs  \
                                                                            --with-mysql  --with-pdo-mysql
[root@VTGDB.COM php-5.6.10]#make
[root@VTGDB.COM php-5.6.10]#make install

Step 4: Find and Edit php configuration file
[root@VTGDB.COM php-5.6.10]# cp php.ini-development /usr/local/lib/php.ini
[root@VTGDB.COM php-5.6.10]# vi /usr/local/lib/php.ini
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Asia/Ho_Chi_Minh

Step 5: Prepare application directory
[root@VTGDB.COM php-5.6.10]# chsh -s /bin/bash apache
[root@VTGDB.COM php-5.6.10]# mkdir -p /u01/qlts/public_html
[root@VTGDB.COM php-5.6.10]# chown –R apache:apache /u01/qlts/public_html

Step 6: Find and Edit httpd configuration file:
[root@VTGDB.COM php-5.6.10]# vi /etc/httpd/conf/httpd.conf
Listen 8080
User apache
Group apache
#    Options FollowSymLinks
#    Allow from all
#    AllowOverride None
    Options FollowSymLinks
    AllowOverride All
#AddType application/x-tar .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php .html
    ServerAdmin thonh53@gmail.com
    DocumentRoot /u01/qlts/public_html
    ServerName VTGDB.COM
    ServerAlias VTGDB
    ErrorLog /u01/qlts/log/error.log
#    CustomLog logs/dummy-host.example.com-access_log common


Step 7: Restart Apache server
[root@VTGDB.COM php-5.6.10]# service httpd restart

Step 8: Test php
[root@VTGDB.COM php-5.6.10]# su – apache
[apache@VTGDB.COM ~]# cd /u01/qlts/public_html
[apache@VTGDB.COM public_html]# vi info.php
<?php 
     phpinfo();
?>              
Open your browser access address: http://YOUR_IP_SERVER:8080/info.php


Friday, April 8, 2016

How to fix Error Vietnamese font on Xampp

[Describe]: 









[FIXED]

Step 1: Open Xampp Control Panel, Click Config on MySQL Module
























Step 2: Open my.ini




















Step 3: Uncomment rows following and save file my.ini

collation_server=utf8_unicode_ci
character_set_server=utf8
skip-character-set-client-handshake
character_sets-dir="C:/xampp/mysql/share/charsets"







Step 4: Restart MySQL Server on XAMPP Control Panel
Step 5: Reload the page

Thursday, October 22, 2015

How to change MySQL datadir



Step 1: Create new data folder for mysql (For example: /u01/mysql/data)
[root@ptudvtg149 ~]# mkdir -p /u01/mysql/data

Step 2: Copy all old data of mysql to new folder ( old folder: /var/lib/mysql)
[root@ptudvtg149 mysql]# cp -r /var/lib/mysql /u01/mysql/data/
[root@ptudvtg149 mysql]#chown -R mysql:mysql /u01/myql
Step 3: Edit /etc/my.cnf
 [root@ptudvtg149 data]# vi /etc/my.cnf
[mysqld]
datadir=/u01/mysql/data
socket=/u01/mysql/data/mysql.sock         
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[mysqld]
default-time-zone='+00:00'
[client]
socket=/u01/mysql/data/mysql.sock
port=3306

Step 4: Init new data_dir
[root@ptudvtg149 mysql]# mysql_install_db --user=mysql --datadir=/u01/mysql/data
Installing MySQL system tables...
OK
Filling help tables...
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:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h ptudvtg149 password 'new-password'

Alternatively you can run:
/usr/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 /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!
Step 5: Restart and check again mysql
[root@ptudvtg149 mysql]# service mysqld restart
Stopping mysqld:                                           [  OK  ]
Starting mysqld:                                           [  OK  ]
[root@ptudvtg149 mysql]# ps -ef | grep mysql
root      8365     1  0 14:42 pts/1    00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/u01/mysql/data --socket=/u01/mysql/data/mysql.sock --pid-file=/var/run/mysqld/mysqld.pid --basedir=/usr --user=mysql
mysql     8470  8365  0 14:42 pts/1    00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/u01/mysql/data --user=mysql --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/u01/mysql/data/mysql.sock
root      8593  6957  0 14:43 pts/1    00:00:00 grep mysql


Monday, June 22, 2015

MySQL - Resetting a lost MySQL root password

Not the Server root user

A common issue is confusing the Server root user with the MySQL root user.
The Server root user is the server's main user. The MySQL root user has complete control over MySQL only. The two 'root' users are not connected in any way.

Stop MySQL

The first thing to do is stop MySQL. If you are using Ubuntu or Debian the command is as follows:
sudo /etc/init.d/mysql stop
For CentOS, Fedora, and RHEL the command is:
sudo /etc/init.d/mysqld stop

Safe mode

Next we need to start MySQL in safe mode - that is to say, we will start MySQL but skip the user privileges table. Again, note that you will need to have sudo access for these commands so you don't need to worry about any user being able to reset the MySQL root password:
sudo mysqld_safe --skip-grant-tables &
Note: The ampersand (&) at the end of the command is required.

Login

All we need to do now is to log into MySQL and set the password.
mysql -u root
Note: No password is required at this stage as when we started MySQL we skipped the user privileges table.
Next, instruct MySQL which database to use:
use mysql;

Reset Password

Enter the new password for the root user as follows:
update user set password=PASSWORD("mynewpassword") where User='root';
and finally, flush the privileges:
flush privileges;

Restart

Now the password has been reset, we need to restart MySQL by logging out:
quit
and simply stopping and starting MySQL.

On Ubuntu and Debian:

sudo /etc/init.d/mysql stop
...
sudo /etc/init.d/mysql start

On CentOS and Fedora and RHEL:

sudo /etc/init.d/mysqld stop
...
sudo /etc/init.d/mysql start

Login

Test the new password by logging in:
mysql -u root -p
You will be prompted for your new password.

View more: http://www.rackspace.com/knowledge_center/article/mysql-resetting-a-lost-mysql-root-password

Wednesday, April 29, 2015

Chapter 4: Dumping Applications Manager's data to MySQL 5.1


Prerequisites:

It's very important, you have to backup Applications Manager data before you execute this task. We recommended take complete backup of everything in Applications Manager. ( see Chapter 3)

Dumping Applications Manager's data to MySQL 5.1

When starting Applications Manager, MySQL Server 5.0.5, which is bundled with the product, is started. Applications Manager uses this MySQL by default. We strongly recommend you to use this default database itself. If you need to dump data into your own MySQL in that same machine, follow the steps given below.
1. Edit the database_params.conf file located in the <Applications Manager Home>/working/conf directory and change the following URL.
Default URL: jdbc:mysql://localhost:13326/AMDB
Change to: jdbc:mysql://<HOSTNAME>:<PORT>/<DATABASE>
Change the Username and Password to that of the MySQL Server you use.
For example:
[root@poller1 AppManager10]# vim working/conf/database_params.conf
/$Id$


# url is of the form jdbc:subprotocol:DataSourceName for eg.jdbc:odbc:RMEDB


#url jdbc:mysql://localhost:13327/AMDB?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8 AppModules TopoDB-MapDB-EventDB-AlertDB-PollDB-PolicyDB-USERSTORAGEDB-ApplnDB


url jdbc:mysql://localhost:3306/AMDB?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8 AppModules TopoDB-MapDB-EventDB-AlertDB-PollDB-PolicyDB-USERSTORAGEDB-ApplnDB


# driver name


drivername org.gjt.mm.mysql.Driver AppModules TopoDB-MapDB-EventDB-AlertDB-PollDB-PolicyDB-USERSTORAGEDB-ApplnDB






# login username for database if any


username root AppModules TopoDB-MapDB-EventDB-AlertDB-PollDB-PolicyDB-USERSTORAGEDB-ApplnDB






# login password for the database if any


#encryptedpassword eK6q1CJ9697s7O AppModules TopoDB-MapDB-EventDB-AlertDB-PollDB-PolicyDB-USERSTORAGEDB-ApplnDB


password ********* AppModules TopoDB-MapDB-EventDB-AlertDB-PollDB-PolicyDB-USERSTORAGEDB-ApplnDB


# Number of transactional connections. (This number has to be zero for transaction disable mode).


TRANS_CONNECTIONS 0






# Number of non-transactional connections.


NON_TRANS_CONNECTIONS 6






#database name


databasename MYSQL


~


  1. Edit the AppManager_Home/conf/AMServer.properties file, change the port of MySQL from true to false.
[root@poller1 AppManager10]# vim conf/AMServer.properties
#These are the ports that are used by the server.

am.webserver.port=9090

am.ssl.port=8443

am.ssl.enabled=true

am.slasubgroups.enabled=false

am.subgroups.enabled=true

#If installed as service,then on changing am.ssl.enabled=true, Please follow the steps given in the below troubleshooting link before starting the server. http://manageengine.com/products/applications_manager/troubleshoot.html#g7

am.dbserver.type=mysql

am.mysql.port=13327

am.tomcat.shutdown.port=18005

am.webcontainer.port=18009

am.rmiregistry.port=11099

am.shutdown.port=12000

am.traplistener.port=1620

# specify whether these ports need to be checked or not.


am.mysqlport.check=false

am.webserverport.check=true

# This value is used for testing the availability of services.

am.sockettest.timeout=15

am.discover.managed.weblogic=false

am.server.language=en

am.server.country=US

#am.pingtest.command=/bin/ping -c 1 -w 1

#Start up the browser when the serer starts up.

am.browser.startup=true

am.upload.enabled=true

am.cam.mbeanslistsize=250

am.spacecheck.warning=true

am.server.type=NORM

am.edition.type=

am.adminserver.host=N.A

am.adminserver.port=N.A

am.server.startresidrange=10000000

am.adminserver.deletesql=true

am.standalonesdp.enabled=false

am.ssl.truststore=

# These value are used for supporting websites with Windows NTLM authentication.

am.ntlm.securityprovider=cryptix.jce.provider.CryptixCrypto

am.ntlm.hostname=appmanager.vtg

am.ntlm.hostdomainname=

# The drives begining with the characters given below will not be monitored in server monitor.

am.disks.ignore=

am.weblogic78.authenabled=false

am.telnet.loginTimeOut=30000

am.server.command.responsetimeout=40

am.sendmonerrormail.enabled=true

am.errorpoll.count=3

am.mqdelrow.enabled=false

am.alertmsgchange.enabled=false

am.filesize.unit=KB

am.dirsize.unit=MB

am.script.deleterow=true

am.host.deleteDisk=true

am.processinstance.equals=false

am.executeaction.size=400

am.querymonitor.rowcount=50

am.query.timeout=60

am.ftp.filesize=10
am.appmanager.hostname=appmanager.vtg

am.html.dirsize=10485760

am.htmldata.jre.daystoretain=30

am.htmldata.mysql.daystoretain=30

am.oomexception.duration=30

am.oomexception.count=20

am.report.weekStartDay=1

# The below values is used to enable the Monitor Group Status View option in EnterPrise/Professional Edition Admin Tab.

am.admin.mgstatusview.enabled=false

am.log.dir=../logs/

am.createSupportZipFile=true

am.expandWidgets=false

  1. Start the Applications Manager. Note: When starting Applications Manager, you will get a warning message MySQL Port is used by some other Application. You can ignore this message.
[root@poller1 AppManager10]# nohup sh startApplicationsManager.sh &

[root@poller1 AppManager10]# tailf nohup.out
Log handler name : com.adventnet.management.log.Log4jHandler

XML File name : log4j_conf.xml



Starting Applications Manager "Primary" Server Modules, please wait ...





Process : AMScriptProcess [ Started ]

Process : AMExtProdIntegrationProcess [ Started ]

Process : AuthMgr [ Started ]

Process : AMDataCleanupProcess [ Started ]

Process : NmsPolicyMgr [ Started ]

Process : DBUserStorageServer [ Started ]

Process : StartRelatedServices [ Started ]

Process : NMSMServer [ Started ]

Process : AMUrlMonitorProcess [ Started ]

Process : WSMProcess [ Started ]

Process : RunRmiRegistry [ Started ]

Process : NmsAuthenticationManager [ Started ]

Process : APMTracker [ Started ]

Process : NmsConfigurationServer [ Started ]

Process : StandaloneApplnProcess [ Started ]

Process : RunJSPModule [ Started ]

Process : AMRBMProcess [ Started ]

Process : ApplnStandaloneBE [ Started ]

Process : AMDistributionProcess [ Started ]

Process : AMCAMProcess [ Started ]

Process : NMSSAServer [ Started ]

Process : AMServerStartUp [ Started ]

Process : NmsAuthManager [ Started ]

Process : MapServerBE [ Started ]

Process : Collector [ Started ]

Process : DBServer [ Started ]

Process : AMFaultProcess [ Started ]

Process : AMEventProcess [ Started ]

Process : MonitorsAdder [ Started ]

Process : AMServerFramework [ Started ]

Process : AMDataArchiverProcess [ Started ]

Process : EventFE [ Started ]

Process : AlertFE [ Started ]

Process : NmsMainFE [ Started ]



Verifying connection with web server... verified



Applications Manager started successfully.



Please connect your client to the web server on port: 9090





Chapter 2: Installing and Upgrading MySQL 5.0 to MySQL 5.1


Prerequisites:




Check your OS' version:
[root@poller1 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.5 (Santiago)

Check your existing MySQL that came with the Linux:
[root@poller1 mysql]# rpm -qa | grep -i mysql5.0.95-5.el5_9

perl-DBD-MySQL-3.0007-2.el5

mysql-5.0.95-5.el5_9

mysql-connector-odbc-3.51.30-0

mysql-5.0.95-5.el5_9

Login your existing MySQL and check your database:
[root@PTUDServer3 Desktop]# mysql -u root -p

Enter password:
***********
Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 63

Server version: 5.0.95-log Source distribution



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> show databases;

+--------------------+

| Database |

+--------------------+

| information_schema |

| mysql |

| test |
+--------------------+

3 rows in set (0.37 sec)



mysql>
use test;
Database changed
mysql> show tables;
empty in set (0.00 sec)
mysql>

You ensure haven't any application runs your MySQL. I checked no important application use my MySQL. So, I can remove it.

Remove the existing default MySQL that came with the Linux.

[root@poller1 mysql]# rpm -ev perl-DBD-MySQL-3.0007-2.el5
[root@poller1 mysql]# rpm -ev --allmatches mysql-5.0.95-5.el5_9

warning: /etc/my.cnf saved as /etc/my.cnf.rpmsave



[root@poller1 mysql]# rpm -qa | grep -i mysql

mysql-connector-odbc-3.51.30-0

You have new mail in /var/spool/mail/root

Download MySQL 5.1.73 prepare for installation:

You access the internet via address: http://dev.mysql.com/downloads/mysql/5.1.html to download file.

In Generally Available(GA) Releases tab, Select version 5.1.73 and select Platform: your OS'version, I choose Red Hat Enterprise Linux/ Oracle Linux. Here, you see a list file for download, I get file Red Hat Enterprise Linux 5 / Oracle Linux 5 (x86, 64-bit), RPM Bundle (MySQL-community-5.1.73-1.rhel5.x86_64.rpm-bundle.tar), click Download. You have to login with Oracle Account to download.

Prepare installing Directory:
[root@poller1 ~]# mkdir mysql

[root@poller1 ~]# cd mysql

[root@poller1 mysql]# ls

Transfer installing data to installation directory:
Because I access server via command line (ssh), so I need download file from my computer then transfer data to server.
[root@poller1 mysql]# scp root@192.168.2.133:/root/Downloads/MySQL-community-5.1.73-1.rhel5.x86_64.rpm-bundle.tar .
root@192.168.2.133's password:
***********
MySQL-community-5.1.73-1.rhel5.x86_64.rpm-bundle.tar 100% 156MB 11.2MB/s 00:14

Installing MySQL 5.1.73

Extracting downloaded file to your installing directory:
[root@poller1 mysql]# tar -xvpf MySQL-community-5.1.73-1.rhel5.x86_64.rpm-bundle.tar



MySQL-community-debuginfo-5.1.73-1.rhel5.x86_64.rpm



MySQL-embedded-community-5.1.73-1.rhel5.x86_64.rpm



MySQL-client-community-5.1.73-1.rhel5.x86_64.rpm



MySQL-shared-compat-5.1.73-1.rhel5.x86_64.rpm



MySQL-server-community-5.1.73-1.rhel5.x86_64.rpm



MySQL-devel-community-5.1.73-1.rhel5.x86_64.rpm



MySQL-shared-community-5.1.73-1.rhel5.x86_64.rpm



MySQL-test-community-5.1.73-1.rhel5.x86_64.rpm



[root@poller1 mysql]#



Install MySQL client-server:

[root@poller1 mysql]# rpm -ivh MySQL-server-community-5.1.73-1.rhel5.x86_64.rpm MySQL-client-community-5.1.73-1.rhel5.x86_64.rpm

Preparing... ########################################### [100%]

1:MySQL-client-community ########################################### [ 50%]

Giving mysqld 5 seconds to exit nicely

2:MySQL-server-community ########################################### [100%]



PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

To do so, start the server, then issue the following commands:



/usr/bin/mysqladmin -u root password 'new-password'

/usr/bin/mysqladmin -u root -h poller1 password 'new-password'



Alternatively you can run:

/usr/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.



Please report any problems with the /usr/bin/mysqlbug script!



Starting MySQL.[ OK ]

Giving mysqld 2 seconds to start



Install the “Header and Libraries” that are part of the MySQL-devel packages.

[root@poller1 mysql]# rpm -ivh MySQL-devel-community-5.1.73-1.rhel5.x86_64.rpm

Preparing... ########################################### [100%]

1:MySQL-devel-community ########################################### [100%]

You have new mail in /var/spool/mail/root

[root@poller1 mysql]#

At a bare minimum you should set a password for the root user as shown below:
[root@poller1 mysql]# /usr/bin/mysqladmin -u root password '***********'

You have new mail in /var/spool/mail/root

Editing the MySQL Server configuration file:
[root@poller1 etc]# cp my.cnf.rpmnew my.cnf

You have new mail in /var/spool/mail/root

[root@poller1 etc]# vim /etc/my.cnf

[mysqld]

port = 3306

datadir=/var/lib/mysql

log-bin=/var/lib/mysql/poller1-bin

max_binlog_size=4096

binlog_format=row

socket=/tmp/mysql.sock

user=mysql

# Default to using old password format for compatibility with mysql 3.x

# clients (those using the mysqlclient10 compatibility package).

old_passwords=1



# Disabling symbolic-links is recommended to prevent assorted security risks;

# to do so, uncomment this line:

# symbolic-links=0



[mysqld_safe]

log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

[client]

port = 3306

socket=/tmp/mysql.sock

Restarting MySQL Server:
[root@poller1 etc]# service mysql restart

Shutting down MySQL... [ OK ]

Starting MySQL. [ OK ]

Login your new MySQL 5.1:
[root@poller1 etc]# mysql -u root -p

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 64

Server version: 5.1.73-community-log MySQL Community Server (GPL)



Copyright (c) 2000, 2010, 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 |

| mysql |

| test |

+--------------------+

3 rows in set (0.00 sec)






mysql> create database AMDB;

Query OK, 1 row affected (0.02 sec)

Create database AMDB;

mysql> commit;

Query OK, 0 rows affected (0.00 sec)



mysql>