Tuesday, November 15, 2011

Step by Step installation of mysql under linux using source file.

# groupadd mysql
# useradd -r -g mysql mysql
# cd /usr/local
# tar zxvf /path/to/mysql-VERSION-OS.tar.gz
# ln -s full-path-to-mysql-VERSION-OS mysql
# cd mysql
# chown -R mysql .
# chgrp -R mysql .
# scripts/mysql_install_db --user=mysql
# chown -R root .
# chown -R mysql data ;

# cp support-files/my-medium.cnf /etc/my.cnf ;

# bin/mysqld_safe --user=mysql &

# cp support-files/mysql.server /etc/init.d/mysql.server ;
# ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql ;
# ln -s /usr/local/mysql/bin/mysqladmin /usr/bin/mysqladmin ;
# /etc/init.d/mysql.server restart ;
# chkconfig mysql.server on ;

Delete ALL users who are not root:
mysql> delete from mysql.user where not (host="localhost" and user="root");
Query OK, 5 rows affected (0.15 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql>
Change root database admin password: (note: once this step is complete you’ll need to login with: mysql -p -u root)
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('mypass');
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)


Change root username to something less guessable for higher security.
mysql> update mysql.user set user="mydbadmin" where user="root";
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2 Changed: 2 Warnings: 0

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
Remove anonymous access to the database(s):
mysql> DELETE FROM mysql.user WHERE User = '';
Query OK, 2 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
Add a new user with database admin privs for all databases:
mysql> GRANT ALL PRIVILEGES ON *.* TO 'warren'@'localhost' IDENTIFIED BY 'mypass' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
Add a MySQL database:
mysql> create database bugzilla;
Query OK, 1 row affected (0.15 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
Configuring the ODBC Connector under wine

downlaod mysql connector
http://mysql.mirror.iweb.ca/Downloads/Connector-ODBC/5.1/mysql-connector-odbc-5.1.9-win32.msi
downlaod MDAC
http://software-files-l.cnet.com/s/software/10/72/94/97/mdac_typ.exe?e=1321303803&h=703f96c1be2d85c8a1be98dab1ff2220&lop=link&ptype=1901&ontid=10250&siteId=4&edId=3&spi=6cb40692746e8d5a1961a5439319e4c2&pid=10729497&psid=10729498&&fileName=mdac_typ.exe

Install Mdac in wine
wine mdac_typ.exe

Install mysql connector odbc
wine msiexec /i mysql-connector-odbc-5.1.9-win32.msi

configuring ODBC Data Sourc

# wine control

in User DSN add new data source → select new odbc driver - > enter data sourc name ,mysql server ip
,port,user,password,database etc.. check test if succesfully show then click on ok
then apply connection pooling to new odbc driviers. Then Driver meny and selecty driver and apply

No comments:

Post a Comment