1. Trang chủ
  2. » Công Nghệ Thông Tin

MySQL Basics for Visual Learners PHẦN 2 doc

15 352 0
Tài liệu được quét OCR, nội dung có thể không chính xác

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 15
Dung lượng 1,38 MB

Nội dung

Trang 2

5 Whenever the Additional packages needed window appears, click the R cesessosesceseccesecceseecosoecosee 3 button + Additional packages needed Six To satisfy dependencies, the following package(s) also need to be installed: MySQL- -4.0.15-1mdk, MySQL-common-4.0.15-1mdk More info Cancel 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

Trang 3

8 In the Search box, type: apache Search and click the button rpmdrake 9.2 Software Packages Installation Find: innames © apache Search @) 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

Trang 4

In the Packages list, check

apache-1.3.28-3mdk and everything beneath it

Software Packages Installation @®

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 rpmdrake 9.2 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 _ 3 button appears, click the Í$-========= + to be installed: lib CO ee eee E eR REESE ESR ESS REESE ESSE REESE ES

Additional packages needed

Trang 6

1 4 Click the button 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 4> Selected: 0 MB / Free disk space: 4701 MB Search @ Normal information Maximum information oy 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

Trang 8

3 Atthe prompt, type:

su

yourusername@localhost: /home/yourusername - Shell - Konsol)

Session Edit View Bookmarks Settings Help

CS Đo |

[wourusername®1ocalhost wyouruserna#els su

then press the ENTER key on your keyboard

The window should look like this:

Trang 9

4 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:

Trang 10

Tip: 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

Trang 11

5 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‹

Trang 12

Tip: 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 [yourusername@localhost yourusername]$ su Password: Starting MySQL Server OK ]

[root@localhost yourusernané]# exitM™l >

then press ENTER

Trang 13

The 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

Trang 14

Here’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

Trang 15

22

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

Ngày đăng: 08/08/2014, 22:20

TỪ KHÓA LIÊN QUAN