The window should look like this: yourusername@localhost: /home/yourusemame - Shell - Konsole Session Edit View Bookmarks Settings Help [yourusername@localhost yourusername]$ su Passw
Trang 14 Inthe Packages list, check
MySQL-4.0.15-1mdk and everything beneath it
rpmdrake 9.2
Software Packages Installation
@) Mandrake choices All packages, alphabetical @ Normal information
Maximum information
All packages, by group
— a Name: snort-mvsal+flexresn
8 GETTING STARTED WITH MYSQL
Trang 25 Whenever the Additional packages needed window
appears, click the R cesessosesceseccesecceseecosoecosee 3 button
To satisfy dependencies, the following package(s) also need
to be installed:
MySQL- -4.0.15-1mdk, MySQL-common-4.0.15-1mdk
Install
6 Clickthe button
rpmdrake 9.2
Software Packages Installation
Find: innames $- mysql Search
@ Mandrake choices
All packages, alphabetical @ Normal information
All packages, by group Maximum information
- ¬ ^ Name: snort-mysql+flexresp
gda-mysql0-0.2.96-10mdk O Warsioni 20.1-Xndk
libmysql12-4.0.15-1mdk Y Size: 339 KB
ee ee v Summary: Snort with Flexible Response libqt3-mysql-3.1.2-14mdk Y
MySQL-4.0.15-1mdk Y Description: Snort compiled with mysql+flexresp support
Requires snort libnet rpm
MySQL-bench-4.0.15-1mdk Y
MySQL-client-4.0.15-1mdk Y
MySQL-common-4.0.15-1mdk Y
perl-Mysql-1.22_19-8mdk Y
php-mysql-4.3.2-3mdk Y
prelude-manager-mysqI-plugin-0.8.7-2m:t⁄
snort-mysql-2.0.1-3mdk Y
snort-mysql+flexresp-2.0.1-3mdk v
Help Selected: 33 MB / Free disk space: 4848 MB Install h Quit
7 e Insert the Linux CDs as directed
GETTING STARTED WITH MYSQL 9
Trang 38 In the Search box, type:
apache
and click the button
rpmdrake 9.2
Software Packages Installation
@) Mandrake choices All packages, alphabetical @ Normal information
C Maximum information All packages, by group
4 Name: snort-mysql+flexresp Version: 2.0.1-3mdk Size: 339 KB
gda-mysql0-0.2.96-10mdk libmysql12-4.0.15-1mdk libmysql12-devel-4.0.15-1mdk libqt3-mysql-3.1.2-14mdk MySQL-4.0.15-1mdk MySQL-bench-4.0.15-1mdk MyS@L-client-4.0.15-1mdk MySQL-common-4.0.15-1mdk
perl-Mysql-1.22_19-8mdk
php-mysql-4.3.2-3mdk
Summary: Snort with Flexible Response Description: Snort compiled with mysql+flexresp support Requires snort libnet rpm
prelude-manager-mysqI-plugin-0.8.7-2m: 2 snort-mysql-2.0.1-3mdk Y snort-mysql+flexresp-2.0.1-3mdk ` v Help Selected: 33 MB / Free disk space: 4848 MB Install Quit
10 GETTING STARTED WITH MYSQL
Trang 4In the Packages list, check
apache-1.3.28-3mdk
and everything beneath it
a
Find: innames = apache
@ Mandrake choices
All packages, alphabetical
All packages, by group
Vv Search results
apache-1.3.28-3mdk
apache2-devel-2.0.47-6mdk
Help
Search
@ Normal information Maximum information
4 Name: apache-source Version: 1.3.28-3mdk Size: 9375 KB Summary: Apache Source Description: The Apache 1.3 Source, including Mandrake patches and EAPI Use this package to build apache- mod_perl, or your own custom version
Install Quit
appears, click the Í$-=========
+
to be installed:
lib
CO ee eee E eR REESE ESR ESS REESE ESSE REESE ES
Additional packages needed
To satisfy dependencies, the following package(s) also need
apache-modules -1.3.28-3mdk, libdb 3.3-3.3.11-16mdk,
EIES
GETTING STARTED WITH MYSQL
Trang 5Install
1 1 Click the button
rpmdrake 9.2
Software Packages Installation
@) Mandrake choicec
12 GETTING STARTED WITH MYSQL
Trang 61 4 Click the
rpmdrake 9.2
Software Packages Installation
~-
Find: in names + apache
@) Mandrake choices
All packages, alphabetical
All packages, by group
> Development
> Graphical Environment
> Server
> Workstation
Help
Selected: 0 MB / Free disk space: 4701 MB
Search
@ Normal information Maximum information
Name: apache Version: 1.3.28-3mdk Size: 14 KB Summary: The most widely used Web server on the Internet
Description: Apache is a powerful, full-featured, efficient and freely-available Web server Apache is also the most popular Web server on the Internet
This version of Apache includes many optimizations, Extended Application Programming Interface (EAPI), Shared memory module, hooks for SSL modules, and several patches/cosmetic improvements
It is also fully modular, and many modules are available
in pre-compiled format, like PHP4, the Hotwired module and Apache-ASP Also included are
Install a
GETTING STARTED WITH MYSQL 13
Trang 7Start MySQL
1 Log in to your Linux computer using your user account
2 Click the =] icon, then Terminals, then Konsole
A
14 GETTING STARTED WITH MYSQL
Trang 83 Atthe prompt, type:
su
yourusername@localhost: /home/yourusername - Shell - Konsol)
Session Edit View Bookmarks Settings Help
then press the ENTER key on your keyboard
The window should look like this:
yourusername@localhost: /home/yourusemame - Shell - Konsole Session Edit View Bookmarks Settings Help
[yourusername@localhost yourusername]$ su
Password:
GETTING STARTED WITH MYSQL 15
Trang 94 Atthe Password prompt, type:
Your Root user password
yourusername@localhost: /home/yourusername - Shell - Konsol Session Edit View Bookmarks Settings Help
[yourdisername@localhost yourusername]$ su
Password:
Not this particular string, of course, but the actual Root
password for the Linux computer
Then press the ENTER key
The window should look like this:
yourusername@localhost: /home/yourusername - Shell - Konsole Session Edit View Bookmarks Settings Help
[yourusername@localhost yourusername]$ su Password:
[root@localhost yourusernamel]#? J
16 GETTING STARTED WITH MYSQL
Trang 10Tip: Notice the prompt has changed from
[yourusername@localhost yourusername] §
to
[yourusername@localhost yourusername] #
yourusername@localhost: /home/yourusername - Shell - Konsole Session Edit View Bookmarks Settings Help
[youruserpane@ioca tirostyourusername]$ su
Password:
C| [root@localhost yourusernamel# W
There’s now a # at the end of the prompt
$ means you're giving Linux commands as a regular user #
means you re giving commands as the Root user
On any Linux computer, there are regular users and the Root user Giving the su command allows you to give commands as
the “Super User,” or Root user, of the computer
As the Root user, you can add/delete/modify any file on the
computer A regular user can’t do this
The Root user has the power to really mess up the computer, so you should only work as the Root user when necessary
GETTING STARTED WITH MYSQL 17
Trang 115 Next, type:
/etc/re.d/init.d/mysql start
yourusername@localhost: /home/yourusemame - Shell - Konsole
Session Edit View Bookmarks Settings Help [yourusername@localhost yourusernamel$ su
Password:
[root@localhost yourusernamelf /Zetc/rec d/Zinit d/mysql start
then press ENTER
The window should look like this:
yourusername@localhost: /home/yourusername - Shell - Konsole Session Edit View Bookmarks Settings Help
[yourusername@localhost yourusername]$ su
Password:
[root@localhost yourusername]#® Z/etc⁄Zrc đ⁄Zinit đ⁄mysS‹
Starting MySQL Server
OK ]
[root@localhost yourusernamel]#t W
a2
This starts the MySQL server—the program mysq]1 in the /etc/rce.d/init.d/ directory
18 GETTING STARTED WITH MYSQL
Trang 12Tip: If you are not sure whether or not the MySQL Server is
running, type:
/etc/re.d/init.d/mysql status
If it’s running, the window will look like this:
yourusername@localhost: /home/yourusemame - Shell -Konsole <2>
Session Edit View Bookmarks Settings Help
[yourusername@localhost yourusername]$ su
Password:
[root@localhost yourusername]# Zetc/rec dZinit d/Zmysql status
mysqld (pid 8347) is running
#346 (pid 8345) 1 running
[root@localhost yourusernamel?#? J
yourusermame@localhost: /home/yourusername - Shell - Konsole Session Edit View Bookmarks Settings Help
Password:
OK ]
[root@localhost yourusernané]# exitM™l >
GETTING STARTED WITH MYSQL 19
Trang 13The prompt has now changed to:
[yourusername@localhost yourusername] $
Linux Root privileges were only needed to start MySQL, so you ve logged out as the Linux computer’s Super (Root) User
7 Atthe [yourusername@localhost yourusername] $
prompt, type:
mysql -u root mysql
yourusemame@localhost: /home/yourusemame - Shell - Konsole IBI Session Edit View Bookmarks Settings Help
[yourusername@localhost yourusername]$ su Password:
[root@localhost yourusername]# Zetc/rcec dZinit dZmysql start
Starting MySQl Server
OK | [root@localhost yourusername]# exit exit
[yourusername@localhost yourusername]$6 mysql —-u root mysql
then press ENTER
The window should look like this, with a mysql> prompt:
yourusername@localhost: /home/yourusername - Shell - Konsole Session Edit View Bookmarks Settings Help
[yourusername@localhost yourusername]$ su Password:
[root@localhost yourusername]# Zetc/re dZinit d/Zmysql start
Starting MySQL Server OKE ]
[root@localhost yourusername]# exit
exit
[yourusername@localhost yourusername]$ mysql —-u root mysql Reading table information for completion of table and column nam
es You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor Commands end with ; or
Your MySQL connection id is 1 to server version: 4.0.15
aa
oS
Type "he@1p;’ or ‘Nh’ for help Type ‘'Nc’ to clear the buffer
mysql Oo
a2
20 GETTING STARTED WITH MYSQL
Trang 14Here’s what this string of commands means:
e mysql
mysql -u root mysql
This first mysql starts the MySQL client
MySQL is made up of two parts: the MySQL server program and a MySQL client program
The MySQL server program handles the storage of the data The MySQL client program allows you to give commands to the MySQL server
You need both parts to make MySQL work
e@ -u root
mysql -u root mysql
The -u command tells the MySQL client that you want to log into the MySQL server as a particular user root denotes the root user of the MySQL server
Youre not logging into the Linux computer as the Root user; you're logging into the MySQL server as its root user This gives you total control over the MySQL server
GETTING STARTED WITH MYSQL 21
Trang 1522
C ee SET PASSWORD FOR root@localhost=PASSWORD ('’ textbook’ ) ;
e mysql mysql -u root mysql
This last mysql] refers to a database called mysq1 that you'll
use initially This database is included by default in the MySQL server
The database mysql] has several tables, including one that
describes who can use the MySQL server
Type:
SET PASSWORD FOR
root@localhost=PASSWORD ( ‘textbook’ ) ;
The window should look like this:
yourusername@localhost: /home/yourusemamae - Shell - Konsole I|®|X
Session Edit View Bookmarks Settings Help [yourusername@localhost yourusername]$ su Password:
[Lroot@localhost yourusername]# Zetc/rcec dZinit d/mysql start Starting MySQL Server
OK ]
[Lroot@localhost yourusername]# exit exit
[yourusername@localhost yourusername]$ mysql -u root mysql Reading table information for completion of table and column nam
es
You can turn off this feature to get a quicker startup with FŠ Welcome to the MySQL monitor Commands end with ; or Ng
Your MySQL connection id _:5-+ to serveor-version: 4.0.15
Tvỳe” help:;:' or ‘Nh’ for help Type ‘Nc’ to clear the buff €r-
Query OK, O rows affected (0.02 sec) )
mysql> W
ae)
This string of commands sets the password for the root user on the MySQL server to textbook
GETTING STARTED WITH MYSQL