Congrats ! Finally my LAMP server was installed. I have been struggling with the dude over a month and finally it was up today. Now I can experiment with my PHP installation and create some good web pages.
What I observed during the install process as I installed all components externally, setting up Apache and PHP is quite simple and there are even many blogs and posts for them. Ultimately one faces problem setting up the MySQL server which is what I am going to discuss now.
Setting up MySQL consist of 3 basic steps :
- Install the MySQL server packages.
- Create a new password for root.
- Create a new database.
As far as installing MySQL packages is concerned it can be installed via software updater using the installation source DVD or they can be downloaded from MySQL website. Installation is no more an issue with all the new distros.
Next is the creation of root password for the user to log into the database.
NOTE: This root is not the root account of your system. This is the root user for MySQL server.
Root password can be changed by using the following command:
mysqladmin -u root password “yourpassword”
Check whether the MySQL server is running on your system or not:
chkconfig mysql on
If it is not running then start MySQL server:
service mysql start
Now you need to create a database on this server.
mysqladmin -u root -p “dbname”
After this it will ask for your root password . Enter the password you just created for the root user.
That’s it. Congrats your server has now been configured and ready for use.
Now you can log in to your database server and configure your database, execute queries.
To log in just type
sql -u root -p “dbname”
Then enter your password and you are in.
For more detailed information check out the original post at linux.org.
