Slide

  • LINUX

    LINUX:In 1969 AT&T made a decision to withdraw Multics and go with GECOS (General Electric Comprehensive Operating Supervisor / System), with AT & T in Bells Lab when Multics was withdrawn some of the programmers named Ken Thompson and Dennis Ritchie decided to rewrite operating system in order to support low cost computer..To Know More

    CLICK HERE

  • MICROSOFT

    MICROSOFT:Microsoft was established to develop and sell BASIC interpreters for the Altair 8800. It rose to dominate the home computer operating system market with MS-DOS in the mid-1980s,followed by the Microsoft Windows line of operating systems. To Know More

    CLICK HERE

  • CISCO

    CISCO:During the early 1980s, there was a married couple namely Len and Sandy Bosack who used to work in two different departments of computer located in Stanford University. This couple was facing problem in making their computers communicate with each other To Know More

    CLICK HERE

showinfo=1

Installing MYSQL





How to installing MySQL server on CentOS 5 x64 -

1. Login as root user to server.

2. Execute following commands from shell:

# yum install mysql mysql-server mysql-devel
This command will check system configuration and calculates the dependencies required to run Mysql. It will display the list of packages need to be installed and in the end:
……
Total download size: 35 M
is this ok [y/N]: y
Press ‘y’ like above. This will install mysql server and mysql client on your machine.


3. Now mysql is installed on your server. Now if you execute the following command to connect to mysql 

# mysql

And error message like this below is printed:
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)
Then it means mysql is not running. You need to start the mysql service first. So execute following command:
# /etc/init.d/mysqld start
It will print the following message:
Starting MySQL:                                            [  OK  ]
It means everything is fine. Mysql is up and running and ready to connect on default port 3306.

4. Now you can connect to mysql from shell prompt. Execute following command:

# mysql

You might get this error message:
ERROR 1045 (28000): Access denied for user ‘root’@'localhost’ (using password: NO)
Now you might think that you have not provided password that is why above error message. So you try again using -p option like this

# mysql -u root -p
Enter password:

ERROR 1045 (28000): Access denied for user ‘root’@'localhost’ (using password: NO)
Oops error message again. The Mysql is installed with blank password, so you must be wondering what went wrong. But you need to check with which user name mysql has been installed. (In my case MySQL is installed with default user ‘mysql’).

You need to check ‘/etc/my.cnf’ file and check following ‘user’ property in ‘mysqld’ section:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
So like above ‘mysql’ is default user with blank password. Now you can connect as follow (As password is blank so hit enter when asked to enter password.):

# mysql -u mysql -p
Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.0.77 Source distribution
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
mysql>

5. OK. Good going till now. When you try to execute “use mysql;” command and if you get error message like this -

ERROR 1045 (28000): Access denied for user ”@’localhost’ (using password: NO)
Then you must be wondering what the hell happened. I mean even If not root then atleast mysql user should have been able to execute all the SQL statements like - create database, alter database, or even a simple use or select statement, but it is not happening. Somehow it seems that mysql user has no priviledges. Now follow below points. Come out of the mysql prompt using quit command or Ctrl+C

6. Stop mysql server by executing following command:

# /etc/init.d/mysqld stop.

Once you get the success message go to step 7.

7. Start MySQL in safe with skipping grant tables that stores the password. Execute following command:

# mysqld_safe –skip-grant-tables

8. Now connect to mysql server as root user :

# mysql –user=root

9. Now change the password by executing following commands and then exit:

# mysql > update user set Password=PASSWORD(’new-password’) where user=’root’;

# mysql > flush privileges;

# mysql > exit;

Here new-password should have value which you want to have for root user while connecting to MySQL server.

10. Now Reconnect to mysql-server using ‘new-password’ you set in step 9:

# mysql -u mysql -p
Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.0.77 Source distribution
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
mysql>


Now you are connected to mysql with root privileges.

14 comments:

  1. Must say that overall I am really impressed with this blog. It is easy to see that you are passionate about your writing. If only I had your writing ability I look forward to more updates and will be returning.
    http://www.conenpanama.org |

    ReplyDelete
  2. I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well.. 
    http://www.tgihealthcareprofessionals.com |

    ReplyDelete
  3. You may post on the professional credentials for the blog owner. You could express it's outstanding. Your blog experience can springboard your click through.
    www.spanien-transport.org |

    ReplyDelete
  4. You might write about the services on the blog. You should disclose it's refreshing. Your blog conclusion could accelerate your shoppers.
    myhavenhomes.com |

    ReplyDelete
  5. It is really a nice and useful piece of information. I am glad that you shared this helpful information with us. Please stay us up to date like this. Thank you for sharing.
    auto-satisfait.com |

    ReplyDelete
  6. Fantastic post however I was wanting to know if you could write a litte more on this subject? I'd be very thankful if you could elaborate a little bit more. Cheers!
    http://www.luzmiamihomes.com |

    ReplyDelete
  7. With a lot of secrets out there people can never deny why there are so many inspectors.
    www.metrasafety.com |

    ReplyDelete
  8. Hi there, its pleasant article about media print, we all understand media is a fantastic source of information.
    http://www.yourhautecouture.com |

    ReplyDelete
  9. I think this is definitely an amazing project here. So much good will be coming from this project. The ideas and the work behind this will pay off so much.
    nysmallbusinesshub |

    ReplyDelete
  10. I'm now not sure the place you are getting your information, but good topic. I must spend a while finding out more or understanding more. Thank you for fantastic information I used to be searching for this info for my mission.
    coloradoweddingday.com |

    ReplyDelete
  11. Thanks for the information! Now I know what i will do the next time i travel. Looking forward to go to Thailand later this year! Thanks for some pointers!
    petseminar |

    ReplyDelete
  12. Hi my loved one! I wish to say that this article is awesome, great written and include almost all significant infos. I would like to see more posts like this .
    businessjetpeople.com |

    ReplyDelete
  13. this is so fun to read keep posting such information

    ReplyDelete

Note:- Comment as: Option available to post without login select "Anonymous" from the drop down...........

For Latest Updates: Subscribe Now | | Test Your Knowledge, Take a Quiz now Click Here | | Site Best Viewed In Firefox

X