Installation of MySQL Sever in Ubuntu using Generic Binaries

Installation of MySQL Sever in Ubuntu using Generic Binaries.

To begin the Installation process first download the generic binary from mysql.com or use the below link for downloading MySQL Sever Software

Link to Download Binaries:

https://dev.mysql.com/downloads/mysql/

Steps to Configure MySQL Server:

Create a group with name mysql  in linux all the users belongs to a particular group and every user has a single primary group and can participate in multiple secondary groups  and also create a user by the below is the commands

This is common place to install any software

/usr/local/

Once you copy the software to the above directory the software is a compressed file so uncompress using below command

After uncompressing a directory gets created so just rename it with mysql for convenience

Now execute the file called mysql_install_db which is present in the scripts directory as mysql user which installs mysql software

After installing the software we need to initialize the mysqld process which will not be running once the installation has done

Now copy the mysql.server file from /usr/local/mysql/support-files directory  to /etc/init.d directory for starting the mysql server automatically once the server has rebooted other wise we need to run the command bin/mysqld_safe –user=mysql & always when server has rebooted

All the client and non client programs are stored in the bin directory of the mysql software location

Connecting to MySQL Server using client program

This is the program which connects to the mysql server

Now you can see mysql prompt from where you can access the MySQL server

The above command will display the no of databases

The above command is to find out the current database directory

The above command is to switch the database to mysql database

It will display all the tables of the current database

To find out the users in the current database

Setting the password for the root user:

By default the root user in mysql will not have password to create it we need to run a script called mysql_secure_installation which is present in bin directory of MySQL software location

Before that set the PATH environment variable so that you can execute any programs in bin from any location

Now copy the my-default.cnf file from from mysql/support-files directory into /etc directory with name my.cnf which contains crucial information about MySQL Server

Then execute the file mysql_secure_installation for removing the anonymous users and databases and setting the password for the root user after running the  mysql_secure_installation it asks the current user password so by default it is blank so hit enter then specify the password after setting the password it reloads the privilege table It removes the anonymous users because to restrict the access by other users and also we can disable the remote login for root user for secure connection

Once after setting the password for root user any user is executing mysql program required to specify username and password for connecting MySQL Server

now the anonymous database test will also gets removed

Note: Please test scripts in Non Prod before trying in Production.
1 Star2 Stars3 Stars4 Stars5 Stars (5 votes, average: 5.00 out of 5)
Loading...

Add Comment