You are on page 1of 4

MY SQL INSTALLATION ON ST:

[root@vgetstoif mysql-5.5.25a-linux2.6-x86_64]# /usr/sbin/groupadd mysql


groupadd: group mysql exists

[root@vgetstoif mysql-5.5.25a-linux2.6-x86_64]# /usr/sbin/useradd -r -g mysql mysql


useradd: user mysql exists

[root@vgetstoif mysql-5.5.25a-linux2.6-x86_64]# cd /usr/local/

[root@vgetstoif local]# tar zxvf /var/SP/share/Software/Phase2/MySQL_5.5.25a_Lin_O/mysql5.5.25a-linux2.6-x86_64.tar.gz

[root@vgetstoif local]# ll
total 84
drwxr-xr-x 2 root root 4096 Aug 24 18:08 bin
drwxr-xr-x 2 root root 4096 Oct 1 2009 etc
drwxr-xr-x 2 root root 4096 Oct 1 2009 games
drwxr-xr-x 2 root root 4096 Oct 1 2009 include
drwxr-xr-x 2 root root 4096 Oct 1 2009 lib
drwxr-xr-x 2 root root 4096 Oct 1 2009 lib64
drwxr-xr-x 2 root root 4096 Oct 1 2009 libexec
drwxr-xr-x 13 root root 4096 Sep 5 16:33 mysql-5.5.25a-linux2.6-x86_64
drwxr-xr-x 2 root root 4096 Oct 1 2009 sbin
drwxr-xr-x 4 root root 4096 Jun 13 13:24 share
drwxr-xr-x 2 root root 4096 Oct 1 2009 src

[root@vgetstoif local]# ln -s /usr/local/mysql-5.5.25a-linux2.6-x86_64 mysql


[root@vgetstoif local]# cd mysql
[root@vgetstoif mysql]# chown -R mysql .
[root@vgetstoif mysql]# chgrp -R mysql .
[root@vgetstoif mysql]# scripts/mysql_install_db --user=mysql
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:
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h vgetstoif password 'new-password'
Alternatively you can run:
./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 . ; ./bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd ./mysql-test ; perl mysql-test-run.pl
Please report any problems with the ./bin/mysqlbug script!
[root@vgetstoif mysql]# chown -R root .
[root@vgetstoif mysql]# chown -R mysql data
[root@vgetstoif mysql]# cp support-files/my-medium.cnf /etc/my.cnf

[root@vgetstoif mysql]# bin/mysqld_safe --user=mysql &


[1] 29534
[root@vgetstoif mysql]# 120905 16:47:02 mysqld_safe Logging to '/usr/local/mysql/data/vgetstoif.err'.
120905 16:47:02 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
120905 16:47:04 mysqld_safe mysqld from pid file /usr/local/mysql/data/vgetstoif.pid ended
[root@vgetstoif mysql]# cp support-files/mysql.server /etc/init.d/mysql.server

Login as ssh mysql@10.XX.XX.XX with the proper password. If not known, you can set it by
using root user and using the command passwd mysql and setting a new password.

Go to /usr/local/mysql using that user and run the following command:


./bin/mysqld_safe --user=mysql --log &
Wait till you get the prompt back. Check that the server is up using:
-bash-3.2$ ./bin/mysqladmin version
./bin/mysqladmin Ver 8.42 Distrib 5.5.25a, for linux2.6 on x86_64
Copyright (c) 2000, 2011, 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.
Server version
Protocol version
Connection
UNIX socket
Uptime:

5.5.25a-log
10
Localhost via UNIX socket
/tmp/mysql.sock
39 sec

Threads: 1 Questions: 1 Slow queries: 0 Opens: 33 Flush tables: 1 Open tables: 26


Queries per second avg: 0.025

mysql> grant all on vgeco.* to weloadm@vgeoam identified by 'Password123';

Query OK, 0 rows affected (0.01 sec)

Errors occurred in ST2:


1. Error while starting:
MySQL was unzipped and tar zvxfed on a different mount at /var/SP/weloadm. Though the
location was mentioned correctly in the /usr/local/mysql soft link it still was not able to start
the server properly. To overcome this, install the MySQL db again by running the scripts but
this time as follows and also the command of starting MySQL had to be modified as below:
Using root user:
./scripts/mysql_install_db --user=mysql
--ldata=/var/SP/weloadm/MySQL_5.5.25a_Lin_O/mysql-5.5.25a-linux2.6-x86_64
Using mysql user:
./bin/mysqld_safe --user=mysql --datadir=/var/SP/weloadm/MySQL_5.5.25a_Lin_O/mysql5.5.25a-linux2.6-x86_64 --log &
This ensures that the MySQL gets to know the directory where it has been initialized and
hence starts up normally

2. Error while trying to login:


When we tried the following to connect to the MySQL database once it was started:
bash-3.2$ mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
This occurs if you have by mistake mentioned a password in the /etc/my.cnf file which was
copied earlier in the doc to this location. If there is a password, you should remove it. Then
try above command:
bash-3.2$ mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.5.25a-log MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> grant all on *.* to 'mysql'@'localhost'
-> ;
Query OK, 0 rows affected (0.00 sec)

You might also like