Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Using open source software to design, develop, and deploy a collaborative Web site, Part 4: Build your development environment in Linux

Alister Lewis-Bowen, Senior Software Engineer, IBM 
Alister's photo
Alister Lewis-Bowen is a senior software engineer in IBM's Internet Technology Group. He has worked on Internet and Web technologies as an IBM UK employee since 1993. Alister was brought to the U.S. to work on the Web sites for the IBM-sponsored sports events, then as senior Webmaster for ibm.com. He is currently helping create semantic Web prototypes. Contact Alister at alister@us.ibm.com.
Stephen Evanchik, Software Engineer, IBM 
Stephen's photo
Stephen Evanchik is a software engineer in IBM's Internet Technology Group. He has been a contributor to many open source software projects, the most notable being his IBM TrackPoint driver in the Linux kernel. Stephen is currently working with emerging semantic Web technologies. Contact Stephen at evanchik@us.ibm.com.
Louis Weitzman, Senior Software Engineer, IBM 
Louie's photo
Louis Weitzman is a senior software engineer in IBM's Internet Technology Group. For 30 years he has worked at the intersection of design and computation. He helped develop an XML, fragment-based content management system in use by ibm.com, and currently is involved with bringing the design process to emerging projects. Contact Louis at louisw@us.ibm.com.

Summary:  In this series, you follow along as the IBM Internet Technology Group designs, develops, and deploys a closed community Web site using a suite of software that is freely available. In this tutorial you will learn how to install and configure all the software necessary to develop a Drupal based development environment for Linux™. This tutorial describes how to install and configure the software the group used in their development environment, including Eclipse, MySQL, Drupal, Apache, PHP, phpMyAdmin.

View more content in this series

Date:  11 Aug 2006
Level:  Intermediate

Activity:  24193 views
Comments:  

Configuring MySQL

Depending on your Linux distribution, you may need to start the mysql daemon yourself to prepare the MySQL system database. If you are using SuSE 10.x, you need to enter the following through sudo or as root:



linux:~> /etc/init.d/mysql start

In addition to initializing the system database, you will be reminded to set the MySQL root password. Do that as follows:



linux:~> mysqladmin -u root password [password]

This will set up the root account password for those localhost connections you make to the MySQL database server. Remember the password you use because you'll need it in a moment.

The majority of your interaction with MySQL will be during the configuration and development of your Drupal Web site. To verify that your MySQL installation is correct and the database server is running properly, we'll test that the server is working by connecting to the database named mysql:



linux:~> mysql -u root -p mysql

You will be prompted to enter your password. Then you should see something similar to Listing 2.


Listing 2. MySQL prompt from the command line
                    
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 28 to server version: 4.0.26-log                

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.               

mysql>

If you see the preceding prompt, your MySQL server is running and correctly configured. We are now going to create the Drupal database, drupal_db, and the user, drupal_user, who will own the database. Enter the MySQL commands in Listing 3 at the prompt (where password is the password for the drupal_user user):


Listing 3. Configuring MySQL from the command line
                    
mysql> create database drupal_db;
mysql> grant select, insert, update, delete, create, drop, index, alter, 
       create temporary tables, lock tables 
       on drupal_db.* to 'drupal_user'@'localhost' identified by 'password';
mysql> flush privileges;
mysql> quit

You can also use the grant privileges in Listing 4.


Listing 4. Less secure option

                        
mysql> grant all privileges on drupal_db.* 'drupal_user'@'localhost' identified by
   'password';

This is correct, but not as secure as the more verbose version in Listing 3. You don't want to use it on your production server. We will use the same command in development as in production to practice good security.

Now that MySQL is working we can install and configure Drupal. Keep your terminal window open because we will need it while we install Drupal.

9 of 16 | Previous | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Open source
ArticleID=153467
TutorialTitle=Using open source software to design, develop, and deploy a collaborative Web site, Part 4: Build your development environment in Linux
publish-date=08112006
author1-email=alister@us.ibm.com
author1-email-cc=
author2-email=evanchik@us.ibm.com
author2-email-cc=
author3-email=louisw@us.ibm.com
author3-email-cc=