🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.database
Article #1553

安装mysql

#1553
From: Charlie &
Date: Tue, 01 Aug 2006 21:27
1227 lines
45701 bytes
��װmysql
administrator [webmaster@shouji88.com] ������2006/05/17 20:30:29 ������[148]   
cd /usr/ports/databases/mysql41-server/
make install clean
/usr/local/bin/mysql_install_db
chown -R mysql /var/db/mysql/
chgrp -R mysql /var/db/mysql/
/usr/local/bin/mysqld_safe -user=mysql &
/usr/local/bin/mysqladmin -u root password newpassword

vi /etc/rc.conf
mysql_enable="YES" (��rc.conf�ļ���������д���)

��������5.4-RELEASE-p6+mysql-4.0.25��

cd /usr/ports/databases/mysql40-server
make install clean;

/usr/local/bin/mysql_install_db

chown -R mysql /var/db/mysql
##��һ��һ�������٣�����mysql������������

����mysql
/usr/local/bin/mysqld_safe &
����/usr/local/etc/rc.d/mysql-server.sh start

/usr/local/bin/mysqladmin -u root password '123456'
#һ��Ҫ����������򲻰�ȫ��

rehash

mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 4.0.24

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

mysql>; exit
Bye


��/etc/rc.conf�������mysql_enable="YES"


�����װ���mysqlĬ�ϵ���ݿ�������100����ԶԶ����Ӧ������վ��Ҫ��
#ee /usr/local/bin/mysqld_safe
����Ѱ�ҵ���308�У����кܳ�����$NOHUP_NICENESS��ͷ����>;>; $err_log 2>;&1��β�����б�Ƕ����һ��if����
������ĩβ�� >;>; $err_log 2>;&1ǰ����� -O max_connections=1000 ����ע��ǰ�����һ���ո񣩡�
Ȼ�������ҵ�310�У�Ҳ�Ǻܳ���һ�У���eval "$NOHUP_NICENESS��ͷ����>;>; $err_log 2>;&1��β��ͬ���� >;>;
$err_log 2>;&1ǰ����� -O max_connections=1000 ��

����mysql�Ժ�
cd /usr/local/bin
mysqladmin -uroot -p variables
������һ�����б?��scroll lock�����Ͼ?��Ļ���ܿ���������һ����ʾ
| max_connections | 1000 |
��ô��ʾ��󲢷��������Ѿ��޸ĵ�1000�ˡ�

####��ݱ���Ұ�����ֵ�˵����һ��Ļ������Dz�Ҫ�����Ϊ�á�

һ��־ǿ2,4�ģ�1-2G�ڴ��Ҳ�Ϳ�256��512�����ӡ���ݿ��ÿ�����Ӷ���ռ���൱��cpu,���ڴ档��Ȼ��oracleֻ�ܸ������Դ�����Ӷ��ˣ�
ͳ���ܲ�����


���ˣ�mysql��ݿ��װ���ˡ�

�������ǰ�װphpmyadmin��ͨ��web����������mysql��ݿ⡣
ע���������Ѿ���װ��apache�����Ѿ�֧��php������apache����Ŀ¼Ϊ/usr/www������ٰ�װ��ʱ����ͨ��ports��װ������Ϊ����֮ǰ��
������밲װ�ģ��������滹��Դ������밲װΪ����˵�����ʹ��phpmyadmin��
ports��װҲ�ܷ��㣬

/usr/ports/databases/phpmyadmin
make install clean


Ŀǰ�ȶ��İ汾�Ѿ��� 2.6.3.1������2.5.6��Ҳ�����ã���������ڰ�װ�������µ��ȶ��汾��

tar xjvf phpMyAdmin-2.5.6.tar.bz2
mv phpMyAdmin-2.5.6 /usr/www/phpmyadmin
cd /usr/www/phpmyadmin
ee config.inc.php

��1������$cfg['PmaAbsoluteUri'] = ''; ��
���������ݸ��Ϊ$cfg['PmaAbsoluteUri'] = 'http://���ip������/phpmyadmin/';

(2������ $cfg['Servers'][$i]['auth_type'] = 'config';
���Ϊ $cfg['Servers'][$i]['auth_type'] = 'http';
���ʱ����http://���ip������/phpmyadmin/�����ʵ�ʱ����Ҫ�����û��������

####��������Ķ������ģ�
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '123456';
#�˴���������
/usr/local/bin/mysqladmin -u root password '123456'
������ӵ�����
�����ֱ����http://���ip������/phpmyadmin/�����ʣ�����Ҫ�������û���������ˡ�

find /usr/www/phpmyadmin -type d -exec chmod 755 {} \;
find /usr/www/phpmyadmin -type f -exec chmod 644 {} \;

-----------------����phpmyadminĿ¼��ֻ��֪��������û����Բ鿴��ݿ���Ϣ---------------
ee /usr/local/etc/apache2/httpd.conf

;
deny from all
Options None
AllowOverride AuthConfig
Order deny,allow
;

ee /usr/www/phpmyadmin/.htaccess

AuthType Basic
AuthUserFile /usr/local/phpmyadmin.passwd
AuthName ��͵����ݿ�͵ù�����һ�أ��ٺ�^_^
require valid-user
satisfy any


/usr/local/sbin/htpasswd -bc /usr/local/phpmyadmin.passwd jxtm lovefreebsd

/usr/local/etc/rc.d/apache2.sh restart����apache

��������http://ip������/phpmyadmin/index.php�����ʵ�ʱ�����ʾҪ�û��������ˣ���������jxtm��lovefreebsd��
�Խ�ȥ�ġ�


����mysql��ʹ�ÿɲο����£�
[url=http://w.yi.org/ftp/FAPM/mysql/zh/index.html] [color=red]Mysql���IJ��
[/color]
�򵥵�ʹ�õĻ����ο����ֵ����ӣ�
[url=http://bbs.chinaunix.net/forum/viewtopic.php?t=108435][color=red] ��
mysql�ڿδ��[/color]



��װmysql�������ˡ���û�гɹ�����ҿ��Բο�һ�¡�


ppg_add: Command not found.
sinox# pkg_add -rf mysql50-server
Fetching
ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.0-release/Latest/mysql50-server.tbz...
Done.
Fetching
ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.0-release/All/mysql-client-5.0.9_1.tbz...
Done.
pkg_add: package 'mysql-client-5.0.9_1' conflicts with mysql-client-4.1.13
pkg_add: please use pkg_delete first to remove conflicting package(s) or -f
to force installation
pkg_add: pkg_add of dependency 'mysql-client-5.0.9_1' failed (proceeding
anyway)
Added group "mysql".
Added user "mysql".
pkg_add: can't open dependency file
'/var/db/pkg/mysql-client-5.0.9_1/+REQUIRED_BY'!
dependency registration is incomplete
sinox# whereis mysql
mysql: /usr/local/bin/mysql /usr/local/man/man1/mysql.1.gz
sinox# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (2)
sinox# whereis mysql50-server
mysql50-server: /usr/ports/databases/mysql50-server
sinox# whereis mysql40-server
mysql40-server: /usr/ports/databases/mysql40-server
sinox# pkg_add -rf mysql40-server
Fetching
ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.0-release/Latest/mysql40-server.tbz...hhhhhhhhhhyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyytyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyh
Done.
pkg_add: package 'mysql-server-4.0.25' conflicts with mysql-server-5.0.9_1
pkg_add: -f specified; proceeding anyway
Fetching
ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.0-release/All/mysql-client-4.0.25.tbz...
Done.
pkg_add: package 'mysql-client-4.0.25' conflicts with mysql-client-4.1.13
pkg_add: please use pkg_delete first to remove conflicting package(s) or -f
to force installation
pkg_add: pkg_add of dependency 'mysql-client-4.0.25' failed (proceeding
anyway)
mysql:*:88:
You already have a group "mysql", so I will use it.
mysql:*:88:88::0:0:MySQL Daemon:/nonexistent:/sbin/nologin
You already have a user "mysql", so I will use it.
pkg_add: can't open dependency file
'/var/db/pkg/mysql-client-4.0.25/+REQUIRED_BY'!
dependency registration is incomplete
sinox#
hhhhhhhhhhyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyytyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyh
hhhhhhhhhhyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyytyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyh:
Command not found.
sinox# whereis mysql40-server
mysql40-server: /usr/ports/databases/mysql40-server
sinox# whereis mysql
mysql: /usr/local/bin/mysql /usr/local/man/man1/mysql.1.gz
sinox# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (2)
sinox# man mysql
Formatting page, please wait...Done.
mysql(1) MySQL database mysql(1)



NAME
mysql - text-based client for mysqld, a SQL-based relational database
daemon

USAGE
mysql [OPTIONS] [Database]

SYNOPSIS
mysql [-B|--batch] [-#|--debug= logfile] [-T|--debug-info] [-e|--exec=
command] [-f|--force] [-?|--help] [-h|--host= hostname]
[-n|--unbuffered] [-p[pwd]] [--password=[pwd]] [-P|--port= pnum]
[-q|--quick] [-r|--raw] [-s|--silent] [-S|--socket= snum] [-u|--user=
uname] [-v|--verbose] [-V|--version] [-w|--wait]

DESCRIPTION
The mysql program provides a curses-based interface to the SQL-based
database server daemon, mysqld(1). Full fuller documentation, refer to
the HTML documents installed with the package.

OPTIONS
-B|--batch
Print results with a tab as separator, each row on a new line.

-#|--debug=logfile
Employ the specified debug log.

-T|--debug-info
Print debug information upon exiting.

-e | --exec=command
Execute the specified command and quit (--batch is implicit).

-f|--force
Continue even if the face of a SQL error.

-?|--help
Display a help message and exit.

-h|--host=hostname
Connect to the specified host.

-n|--unbuffered
Flush the buffer after each query.

-p|--password[=pwd]
Employ the specified password when connecting to the database
server. If a password is not supplied, it will be requested
interactively.

-P|--port=pnum
Employ the specified port number for connecting to the database
server.

-q|--quick
Do not cache the result; print it row by row. This may slow
down the server if the output is suspended.

-r|--raw
Write fields without conversion. (used with --batch).

-s|--silent
Silent mode: reduce the amount of output.

-S|--socket=snum
Employ the specified socket file for connecting to the database
server.

-u|--user=uname
Employ the specified user name for logging in to the server.

-v|--verbose
Verbose mode: write more Specifying this option twice produces a
tabular output format.

-V|--version
Print the mysql version number and exit.

-w|--wait
Wait and retry if the database server connection is down.

FILES
/etc/my.cnf MySQL configuration file

/usr/local/bin/mysql Client executable

/usr/local/libexec/mysqld
Server executable

/usr/local/bin/mysqld_safe
executable shell script for starting mysqld
safely

/var/db/mysql location of database files

EXAMPLE
You can also read a backup dump file back into MySQL with:

mysql database < backup-file.sql

SEE ALSO
isamchk(1), isamlog(1), mysqlaccess(1), mysqladmin(1), mysqld(1),
mysqld_multi(1), mysqld_safe(1), mysqldump(1), mysql_fix_privi-
lege_tables(1), mysqlshow(1), mysql_zap(1), perror(1), replace(1)

For more information please refer to the MySQL reference manual, which
may already be installed locally and which is also available online at
http://dev.mysql.com/doc/mysql/en

BUGS
Please refer to http://bugs.mysql.com/ to report bugs.

AUTHOR
Ver 6.3, distribution 4.1.13 Michael (Monty) Widenius
(monty@mysql.com), MySQL AB (http://www.mysql.com/) This software comes
with no warranty. Manual page by R. P. C. Rodgers, Lister Hill
National Center for Biomedical Communication, U.S. National Library of
Medicine (rodgers@nlm.nih.gov).



MySQL 4.1 19 December 2000 mysql(1)
sinox# whereis mysqld
mysqld: /usr/local/man/man1/mysqld.1.gz
sinox# /usr/local/libexec/mysqld
060517 20:38:06 Warning: Can't create test
file /var/db/mysql/sinox.lower-test
/usr/local/libexec/mysqld: Can't change dir to '/var/db/mysql/' (Errcode: 2)
060517 20:38:06 Aborting

060517 20:38:06 /usr/local/libexec/mysqld: Shutdown Complete

sinox# /usr/local/libexec/mysqld
060517 20:38:15 Warning: Can't create test
file /var/db/mysql/sinox.lower-test
/usr/local/libexec/mysqld: Can't change dir to '/var/db/mysql/' (Errcode: 2)
060517 20:38:15 Aborting

060517 20:38:15 /usr/local/libexec/mysqld: Shutdown Complete

sinox# /usr/local/libexec/mysqld start
060517 20:38:25 Warning: Can't create test
file /var/db/mysql/sinox.lower-test
/usr/local/libexec/mysqld: Can't change dir to '/var/db/mysql/' (Errcode: 2)
060517 20:38:25 Aborting

060517 20:38:25 /usr/local/libexec/mysqld: Shutdown Complete

sinox# man mysqld
Formatting page, please wait...Done.
mysqld(1) MySQL database mysqld(1)



NAME
mysqld - The MySQL server demon

USAGE
mysqld [OPTIONS]

SYNOPSIS
mysqld [--ansi] [-b|--basedir=path] [--big-tables] [--bind-address=IP]
[--character-sets-dir=path] [--chroot=path] [-h|--datadir=path]
[--default-character-set=charset] [--default-table-type=type]
[--delay-key-write-for-all-tables] [--enable-locking] [-T|--exit-info]
[--flush] [-?|--help] [--init-file=file] [-L|--language=...]
[-l|--log[=file]] [--log-isam[=file]] [--log-slow-queries[=file]]
[--log-update[=file]] [--log-long-format] [--low-priority-updates]
[--memlock] [ --myisam-recover [=option[,option...]]] where option is
one of DEFAULT, BACKUP, FORCE or QUICK.] [--pid-file=path]
[-P|--port=...] [-o|--old-protocol] [--one-thread] [-O|--set-variable-
var=option] [-Sg|--skip-grant-tables] [--safe-mode] [--secure]
[--skip-concurrent-insert] [--skip-delay-key-write] [--skip-locking]
[--skip-name-resolve] [--skip-networking] [--skip-new]
[--skip-host-cache] [--skip-show-database] [--skip-thread-priority]
[--socket=path] [-t|--tmpdir=path] [-u|--user=user_name] [-V|--version]

DESCRIPTION
--ansi Use ANSI SQL syntax instead of MySQL syntax. See section 5.2
Running MySQL in ANSI Mode.

-b|--basedir=path
Path to installation directory. All paths are usually resolved
relative to this.

--big-tables
Allow big result sets by saving all temporary sets on file. It
solves most 'table full' errors, but also slows down the queries
where in-memory tables would suffice. Since Version 3.23.2,
MySQL is able to solve it automaticaly by using memory for small
temporary tables and switching to disk tables where necessary.

--bind-address=IP
IP address to bind to.

--character-sets-dir=path
Directory where character sets are. See section 10.1.1 The Char-
acter Set Used for Data and Sorting.

--chroot=path
Chroot mysqld daemon during startup. Recommended security mea-
sure. It will somewhat limit LOAD DATA INFILE and SELECT ...
INTO OUTFILE though.

-h|--datadir=path
Path to the database root.

--default-character-set=charset
Set the default character set. See section 10.1.1 The Character
Set Used for Data and Sorting.

--default-table-type=type
Set the default table type for tables. See section 8 MySQL Table
Types.

--delay-key-write-for-all-tables
Don't flush key buffers between writes for any MyISAM table. See
Mysql Manual section 12.2.3 Tuning Server Parameters.

--enable-locking
Enable system locking.

-T|--exit-info
Print some debug info at exit.

--flush
Flush all changes to disk after each SQL command. Normally MySQL
only does a write of all changes to disk after each SQL command
and lets the operating system handle the syncing to disk. See
section 20.2 What to Do if MySQL Keeps Crashing.

-?|--help
Display short help and exit.

--init-file=file
Read SQL commands from this file at startup.

-L|--language=...
Client error messages in given language. May be given as a full
path. See Mysql Manual section 10.1 What Languages Are Supported
by MySQL?.

-l|--log[=file]
Log connections and queries to file.

--log-isam[=file]
Log all ISAM/MyISAM changes to file (only used when debugging
ISAM/MyISAM).

--log-slow-queries[=file]
Log all queries that have taken more than long_query_time sec-
onds to execute to file. See Mysql Manual section 21.5 The Slow
Query Log.

--log-update[=file]
Log updates to file.# where # is a unique number if not given.
See Mysql Manual section 21.3 The Update Log.

--log-long-format
Log some extra information to update log. If you are using
--log-slow-queries then queries that are not using indexes are
logged to the slow query log.

--low-priority-updates
Table-modifying operations (INSERT/DELETE/UPDATE) will have
lower priority than selects. It can also be done via {INSERT |
REPLACE | UPDATE | DELETE} LOW_PRIORITY ... to lower the prior-
ity of only one query, or by SET OPTION SQL_LOW_PRIOR-
ITY_UPDATES=1 to change the priority in one thread. See Mysql
Manual section 12.2.9 Table Locking Issues.

--memlock
Lock the mysqld process in memory. This works only if your sys-
tem supports the mlockall() system call. This may help if you
have a problem where the operating system is causing mysqld to
swap on disk.

--myisam-recover [=option[,option...]]] where option is one of
DEFAULT, BACKUP, FORCE or QUICK.
If this option is used, mysqld will on open check if the table
is marked as crashed or if if the table wasn't closed properly
(The last option only works if you are running with --skip-lock-
ing). If this is the case mysqld will run check on the table. If
the table was corrupted, mysqld will attempt to repair it. The
following options affects how the repair works. DEFAULT The
same as not giving any option to --myisam-recover. BACKUP If
the data table was changed during recover, save a backup of the
`table_name.MYD' data file as `table_name-datetime.BAK'. FORCE
Run recover even if we will loose more than one row from the
.MYD file. QUICK Don't check the rows in the table if there
isn't any delete blocks. Before a table is automaticly
repaired, mysqld will add a note about this in the error log. If
you want to be able to recover from most things without user
intervention, you should use the options BACKUP,FORCE. This will
force a repair of a table even if some rows would be deleted,
but it will keep the old data file as a backup so that you can
later examine what happened.

--pid-file=path
Path to pid file used by mysqld_safe.

-P|--port=...
Port number to listen for TCP/IP connections.

-o|--old-protocol
Use the 3.20 protocol for compatibility with some very old
clients. See Mysql Manual section 4.17.3 Upgrading from Version
3.20 to Version 3.21.

--one-thread
Only use one thread (for debugging under Linux). See Mysql Man-
ual section H.1 Debugging a MySQL server.

-O| --set-variable var=option
Give a variable a value. --help lists variables. You can find a
full description for all variables in the SHOW VARIABLES section
in this manual. See Mysql Manual section 7.28.4 SHOW VARIABLES.
The tuning server parameters section includes information of how
to optimize these. See Mysql Manual section 12.2.3 Tuning
Server Parameters.

-Sg|--skip-grant-tables
This option causes the server not to use the privilege system at
all. This gives everyone full access to all databases! (You can
tell a running server to start using the grant tables again by
executing mysqladmin flush-privileges or mysqladmin reload.)

--safe-mode
Skip some optimize stages. Implies --skip-delay-key-write.

--secure
IP numbers returned by the gethostbyname() system call are
checked to make sure they resolve back to the original hostname.
This makes it harder for someone on the outside to get access by
pretending to be another host. This option also adds some sanity
checks of hostnames. The option is turned off by default in
MySQL Version 3.21 because sometimes it takes a long time to
perform backward resolutions. MySQL Version 3.22 caches host-
names (unless --skip-host-cache is used) and has this option
enabled by default.

--skip-concurrent-insert
Turn off the ability to select and insert at the same time on
MyISAM tables. (This is only to be used if you think you have
found a bug in this feature).

--skip-delay-key-write
Ignore the delay_key_write option for all tables. See Mysql Man-
ual section 12.2.3 Tuning Server Parameters.

--skip-locking
Don't use system locking. To use isamchk or myisamchk you must
shut down the server. See Mysql Manual section 1.6 How Stable
Is MySQL?. Note that in MySQL Version 3.23 you can use REPAIR
and CHECK to repair/check MyISAM tables.

--skip-name-resolve
Hostnames are not resolved. All Host column values in the grant
tables must be IP numbers or localhost.

--skip-networking
Don't listen for TCP/IP connections at all. All interaction with
mysqld must be made via Unix sockets. This option is highly rec-
ommended for systems where only local requests are allowed. How-
ever, this option is unsuitable for systems that use
MIT-pthreads, because the MIT-pthreads package doesn't support
Unix sockets.

--skip-new
Don't use new, possible wrong routines. Implies
--skip-delay-key-write

--skip-host-cache
Never use host name cache for faster name-ip resolution, but
query DNS server on every connect instead.

--skip-show-database
Don't allow 'SHOW DATABASE' commands, unless the user has
process privilege.

--skip-thread-priority
Disable using thread priorities for faster response time.

--socket=path
Socket file to use for local connections instead of default
/tmp/mysql.sock.

-t|--tmpdir=path
Path for temporary files. It may be useful if your default /tmp
directory resides on a partition too small to hold temporary
tables.

-u|--user=user_name
Run mysqld daemon as user user_name. This option is mandatory
when starting mysqld as root.

-V|--version
Output version information and exit.


NOTE
SEE ALSO
isamchk(1), isamlog(1), mysql(1), mysqlaccess(1), mysqladmin(1),
mysqld_multi(1), mysqld_safe(1), mysqldump(1), mysql_fix_privi-
lege_tables(1), mysqlshow(1), mysql_zap(1), perror(1), replace(1)

For more information please refer to the MySQL reference manual, which
may already be installed locally and which is also available online at
http://dev.mysql.com/doc/mysql/en 
administrator [webmaster@shouji88.com] ������2006/05/17 20:30:29 ������[148]   
cd /usr/ports/databases/mysql41-server/
make install clean
/usr/local/bin/mysql_install_db
chown -R mysql /var/db/mysql/
chgrp -R mysql /var/db/mysql/
/usr/local/bin/mysqld_safe -user=mysql &
/usr/local/bin/mysqladmin -u root password newpassword

vi /etc/rc.conf
mysql_enable="YES" (��rc.conf�ļ���������д���)

��������5.4-RELEASE-p6+mysql-4.0.25��

cd /usr/ports/databases/mysql40-server
make install clean;

/usr/local/bin/mysql_install_db

chown -R mysql /var/db/mysql
##��һ��һ�������٣�����mysql������������

����mysql
/usr/local/bin/mysqld_safe &
����/usr/local/etc/rc.d/mysql-server.sh start

/usr/local/bin/mysqladmin -u root password '123456'
#һ��Ҫ����������򲻰�ȫ��

rehash

mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 4.0.24

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

mysql>; exit
Bye


��/etc/rc.conf�������mysql_enable="YES"


�����װ���mysqlĬ�ϵ���ݿ�������100����ԶԶ����Ӧ������վ��Ҫ��
#ee /usr/local/bin/mysqld_safe
����Ѱ�ҵ���308�У����кܳ�����$NOHUP_NICENESS��ͷ����>;>; $err_log 2>;&1��β�����б�Ƕ����һ��if����
������ĩβ�� >;>; $err_log 2>;&1ǰ����� -O max_connections=1000 ����ע��ǰ�����һ���ո񣩡�
Ȼ�������ҵ�310�У�Ҳ�Ǻܳ���һ�У���eval "$NOHUP_NICENESS��ͷ����>;>; $err_log 2>;&1��β��ͬ���� >;>;
$err_log 2>;&1ǰ����� -O max_connections=1000 ��

����mysql�Ժ�
cd /usr/local/bin
mysqladmin -uroot -p variables
������һ�����б?��scroll lock�����Ͼ?��Ļ���ܿ���������һ����ʾ
| max_connections | 1000 |
��ô��ʾ��󲢷��������Ѿ��޸ĵ�1000�ˡ�

####��ݱ���Ұ�����ֵ�˵����һ��Ļ������Dz�Ҫ�����Ϊ�á�

һ��־ǿ2,4�ģ�1-2G�ڴ��Ҳ�Ϳ�256��512�����ӡ���ݿ��ÿ�����Ӷ���ռ���൱��cpu,���ڴ档��Ȼ��oracleֻ�ܸ������Դ�����Ӷ��ˣ�
ͳ���ܲ�����


���ˣ�mysql��ݿ��װ���ˡ�

�������ǰ�װphpmyadmin��ͨ��web����������mysql��ݿ⡣
ע���������Ѿ���װ��apache�����Ѿ�֧��php������apache����Ŀ¼Ϊ/usr/www������ٰ�װ��ʱ����ͨ��ports��װ������Ϊ����֮ǰ��
������밲װ�ģ��������滹��Դ������밲װΪ����˵�����ʹ��phpmyadmin��
ports��װҲ�ܷ��㣬

/usr/ports/databases/phpmyadmin
make install clean


Ŀǰ�ȶ��İ汾�Ѿ��� 2.6.3.1������2.5.6��Ҳ�����ã���������ڰ�װ�������µ��ȶ��汾��

tar xjvf phpMyAdmin-2.5.6.tar.bz2
mv phpMyAdmin-2.5.6 /usr/www/phpmyadmin
cd /usr/www/phpmyadmin
ee config.inc.php

��1������$cfg['PmaAbsoluteUri'] = ''; ��
���������ݸ��Ϊ$cfg['PmaAbsoluteUri'] = 'http://���ip������/phpmyadmin/';

(2������ $cfg['Servers'][$i]['auth_type'] = 'config';
���Ϊ $cfg['Servers'][$i]['auth_type'] = 'http';
���ʱ����http://���ip������/phpmyadmin/�����ʵ�ʱ����Ҫ�����û��������

####��������Ķ������ģ�
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '123456';
#�˴���������
/usr/local/bin/mysqladmin -u root password '123456'
������ӵ�����
�����ֱ����http://���ip������/phpmyadmin/�����ʣ�����Ҫ�������û���������ˡ�

find /usr/www/phpmyadmin -type d -exec chmod 755 {} \;
find /usr/www/phpmyadmin -type f -exec chmod 644 {} \;

-----------------����phpmyadminĿ¼��ֻ��֪��������û����Բ鿴��ݿ���Ϣ---------------
ee /usr/local/etc/apache2/httpd.conf

;
deny from all
Options None
AllowOverride AuthConfig
Order deny,allow
;

ee /usr/www/phpmyadmin/.htaccess

AuthType Basic
AuthUserFile /usr/local/phpmyadmin.passwd
AuthName ��͵����ݿ�͵ù�����һ�أ��ٺ�^_^
require valid-user
satisfy any


/usr/local/sbin/htpasswd -bc /usr/local/phpmyadmin.passwd jxtm lovefreebsd

/usr/local/etc/rc.d/apache2.sh restart����apache

��������http://ip������/phpmyadmin/index.php�����ʵ�ʱ�����ʾҪ�û��������ˣ���������jxtm��lovefreebsd��
�Խ�ȥ�ġ�


����mysql��ʹ�ÿɲο����£�
[url=http://w.yi.org/ftp/FAPM/mysql/zh/index.html] [color=red]Mysql���IJ��
[/color]
�򵥵�ʹ�õĻ����ο����ֵ����ӣ�
[url=http://bbs.chinaunix.net/forum/viewtopic.php?t=108435][color=red] ��
mysql�ڿδ��[/color]



��װmysql�������ˡ���û�гɹ�����ҿ��Բο�һ�¡�


ppg_add: Command not found.
sinox# pkg_add -rf mysql50-server
Fetching
ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.0-release/Latest/mysql50-server.tbz...
Done.
Fetching
ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.0-release/All/mysql-client-5.0.9_1.tbz...
Done.
pkg_add: package 'mysql-client-5.0.9_1' conflicts with mysql-client-4.1.13
pkg_add: please use pkg_delete first to remove conflicting package(s) or -f
to force installation
pkg_add: pkg_add of dependency 'mysql-client-5.0.9_1' failed (proceeding
anyway)
Added group "mysql".
Added user "mysql".
pkg_add: can't open dependency file
'/var/db/pkg/mysql-client-5.0.9_1/+REQUIRED_BY'!
dependency registration is incomplete
sinox# whereis mysql
mysql: /usr/local/bin/mysql /usr/local/man/man1/mysql.1.gz
sinox# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (2)
sinox# whereis mysql50-server
mysql50-server: /usr/ports/databases/mysql50-server
sinox# whereis mysql40-server
mysql40-server: /usr/ports/databases/mysql40-server
sinox# pkg_add -rf mysql40-server
Fetching
ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.0-release/Latest/mysql40-server.tbz...hhhhhhhhhhyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyytyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyh
Done.
pkg_add: package 'mysql-server-4.0.25' conflicts with mysql-server-5.0.9_1
pkg_add: -f specified; proceeding anyway
Fetching
ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.0-release/All/mysql-client-4.0.25.tbz...
Done.
pkg_add: package 'mysql-client-4.0.25' conflicts with mysql-client-4.1.13
pkg_add: please use pkg_delete first to remove conflicting package(s) or -f
to force installation
pkg_add: pkg_add of dependency 'mysql-client-4.0.25' failed (proceeding
anyway)
mysql:*:88:
You already have a group "mysql", so I will use it.
mysql:*:88:88::0:0:MySQL Daemon:/nonexistent:/sbin/nologin
You already have a user "mysql", so I will use it.
pkg_add: can't open dependency file
'/var/db/pkg/mysql-client-4.0.25/+REQUIRED_BY'!
dependency registration is incomplete
sinox#
hhhhhhhhhhyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyytyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyh
hhhhhhhhhhyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyytyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyh:
Command not found.
sinox# whereis mysql40-server
mysql40-server: /usr/ports/databases/mysql40-server
sinox# whereis mysql
mysql: /usr/local/bin/mysql /usr/local/man/man1/mysql.1.gz
sinox# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (2)
sinox# man mysql
Formatting page, please wait...Done.
mysql(1) MySQL database mysql(1)



NAME
mysql - text-based client for mysqld, a SQL-based relational database
daemon

USAGE
mysql [OPTIONS] [Database]

SYNOPSIS
mysql [-B|--batch] [-#|--debug= logfile] [-T|--debug-info] [-e|--exec=
command] [-f|--force] [-?|--help] [-h|--host= hostname]
[-n|--unbuffered] [-p[pwd]] [--password=[pwd]] [-P|--port= pnum]
[-q|--quick] [-r|--raw] [-s|--silent] [-S|--socket= snum] [-u|--user=
uname] [-v|--verbose] [-V|--version] [-w|--wait]

DESCRIPTION
The mysql program provides a curses-based interface to the SQL-based
database server daemon, mysqld(1). Full fuller documentation, refer to
the HTML documents installed with the package.

OPTIONS
-B|--batch
Print results with a tab as separator, each row on a new line.

-#|--debug=logfile
Employ the specified debug log.

-T|--debug-info
Print debug information upon exiting.

-e | --exec=command
Execute the specified command and quit (--batch is implicit).

-f|--force
Continue even if the face of a SQL error.

-?|--help
Display a help message and exit.

-h|--host=hostname
Connect to the specified host.

-n|--unbuffered
Flush the buffer after each query.

-p|--password[=pwd]
Employ the specified password when connecting to the database
server. If a password is not supplied, it will be requested
interactively.

-P|--port=pnum
Employ the specified port number for connecting to the database
server.

-q|--quick
Do not cache the result; print it row by row. This may slow
down the server if the output is suspended.

-r|--raw
Write fields without conversion. (used with --batch).

-s|--silent
Silent mode: reduce the amount of output.

-S|--socket=snum
Employ the specified socket file for connecting to the database
server.

-u|--user=uname
Employ the specified user name for logging in to the server.

-v|--verbose
Verbose mode: write more Specifying this option twice produces a
tabular output format.

-V|--version
Print the mysql version number and exit.

-w|--wait
Wait and retry if the database server connection is down.

FILES
/etc/my.cnf MySQL configuration file

/usr/local/bin/mysql Client executable

/usr/local/libexec/mysqld
Server executable

/usr/local/bin/mysqld_safe
executable shell script for starting mysqld
safely

/var/db/mysql location of database files

EXAMPLE
You can also read a backup dump file back into MySQL with:

mysql database < backup-file.sql

SEE ALSO
isamchk(1), isamlog(1), mysqlaccess(1), mysqladmin(1), mysqld(1),
mysqld_multi(1), mysqld_safe(1), mysqldump(1), mysql_fix_privi-
lege_tables(1), mysqlshow(1), mysql_zap(1), perror(1), replace(1)

For more information please refer to the MySQL reference manual, which
may already be installed locally and which is also available online at
http://dev.mysql.com/doc/mysql/en

BUGS
Please refer to http://bugs.mysql.com/ to report bugs.

AUTHOR
Ver 6.3, distribution 4.1.13 Michael (Monty) Widenius
(monty@mysql.com), MySQL AB (http://www.mysql.com/) This software comes
with no warranty. Manual page by R. P. C. Rodgers, Lister Hill
National Center for Biomedical Communication, U.S. National Library of
Medicine (rodgers@nlm.nih.gov).



MySQL 4.1 19 December 2000 mysql(1)
sinox# whereis mysqld
mysqld: /usr/local/man/man1/mysqld.1.gz
sinox# /usr/local/libexec/mysqld
060517 20:38:06 Warning: Can't create test
file /var/db/mysql/sinox.lower-test
/usr/local/libexec/mysqld: Can't change dir to '/var/db/mysql/' (Errcode: 2)
060517 20:38:06 Aborting

060517 20:38:06 /usr/local/libexec/mysqld: Shutdown Complete

sinox# /usr/local/libexec/mysqld
060517 20:38:15 Warning: Can't create test
file /var/db/mysql/sinox.lower-test
/usr/local/libexec/mysqld: Can't change dir to '/var/db/mysql/' (Errcode: 2)
060517 20:38:15 Aborting

060517 20:38:15 /usr/local/libexec/mysqld: Shutdown Complete

sinox# /usr/local/libexec/mysqld start
060517 20:38:25 Warning: Can't create test
file /var/db/mysql/sinox.lower-test
/usr/local/libexec/mysqld: Can't change dir to '/var/db/mysql/' (Errcode: 2)
060517 20:38:25 Aborting

060517 20:38:25 /usr/local/libexec/mysqld: Shutdown Complete

sinox# man mysqld
Formatting page, please wait...Done.
mysqld(1) MySQL database mysqld(1)



NAME
mysqld - The MySQL server demon

USAGE
mysqld [OPTIONS]

SYNOPSIS
mysqld [--ansi] [-b|--basedir=path] [--big-tables] [--bind-address=IP]
[--character-sets-dir=path] [--chroot=path] [-h|--datadir=path]
[--default-character-set=charset] [--default-table-type=type]
[--delay-key-write-for-all-tables] [--enable-locking] [-T|--exit-info]
[--flush] [-?|--help] [--init-file=file] [-L|--language=...]
[-l|--log[=file]] [--log-isam[=file]] [--log-slow-queries[=file]]
[--log-update[=file]] [--log-long-format] [--low-priority-updates]
[--memlock] [ --myisam-recover [=option[,option...]]] where option is
one of DEFAULT, BACKUP, FORCE or QUICK.] [--pid-file=path]
[-P|--port=...] [-o|--old-protocol] [--one-thread] [-O|--set-variable-
var=option] [-Sg|--skip-grant-tables] [--safe-mode] [--secure]
[--skip-concurrent-insert] [--skip-delay-key-write] [--skip-locking]
[--skip-name-resolve] [--skip-networking] [--skip-new]
[--skip-host-cache] [--skip-show-database] [--skip-thread-priority]
[--socket=path] [-t|--tmpdir=path] [-u|--user=user_name] [-V|--version]

DESCRIPTION
--ansi Use ANSI SQL syntax instead of MySQL syntax. See section 5.2
Running MySQL in ANSI Mode.

-b|--basedir=path
Path to installation directory. All paths are usually resolved
relative to this.

--big-tables
Allow big result sets by saving all temporary sets on file. It
solves most 'table full' errors, but also slows down the queries
where in-memory tables would suffice. Since Version 3.23.2,
MySQL is able to solve it automaticaly by using memory for small
temporary tables and switching to disk tables where necessary.

--bind-address=IP
IP address to bind to.

--character-sets-dir=path
Directory where character sets are. See section 10.1.1 The Char-
acter Set Used for Data and Sorting.

--chroot=path
Chroot mysqld daemon during startup. Recommended security mea-
sure. It will somewhat limit LOAD DATA INFILE and SELECT ...
INTO OUTFILE though.

-h|--datadir=path
Path to the database root.

--default-character-set=charset
Set the default character set. See section 10.1.1 The Character
Set Used for Data and Sorting.

--default-table-type=type
Set the default table type for tables. See section 8 MySQL Table
Types.

--delay-key-write-for-all-tables
Don't flush key buffers between writes for any MyISAM table. See
Mysql Manual section 12.2.3 Tuning Server Parameters.

--enable-locking
Enable system locking.

-T|--exit-info
Print some debug info at exit.

--flush
Flush all changes to disk after each SQL command. Normally MySQL
only does a write of all changes to disk after each SQL command
and lets the operating system handle the syncing to disk. See
section 20.2 What to Do if MySQL Keeps Crashing.

-?|--help
Display short help and exit.

--init-file=file
Read SQL commands from this file at startup.

-L|--language=...
Client error messages in given language. May be given as a full
path. See Mysql Manual section 10.1 What Languages Are Supported
by MySQL?.

-l|--log[=file]
Log connections and queries to file.

--log-isam[=file]
Log all ISAM/MyISAM changes to file (only used when debugging
ISAM/MyISAM).

--log-slow-queries[=file]
Log all queries that have taken more than long_query_time sec-
onds to execute to file. See Mysql Manual section 21.5 The Slow
Query Log.

--log-update[=file]
Log updates to file.# where # is a unique number if not given.
See Mysql Manual section 21.3 The Update Log.

--log-long-format
Log some extra information to update log. If you are using
--log-slow-queries then queries that are not using indexes are
logged to the slow query log.

--low-priority-updates
Table-modifying operations (INSERT/DELETE/UPDATE) will have
lower priority than selects. It can also be done via {INSERT |
REPLACE | UPDATE | DELETE} LOW_PRIORITY ... to lower the prior-
ity of only one query, or by SET OPTION SQL_LOW_PRIOR-
ITY_UPDATES=1 to change the priority in one thread. See Mysql
Manual section 12.2.9 Table Locking Issues.

--memlock
Lock the mysqld process in memory. This works only if your sys-
tem supports the mlockall() system call. This may help if you
have a problem where the operating system is causing mysqld to
swap on disk.

--myisam-recover [=option[,option...]]] where option is one of
DEFAULT, BACKUP, FORCE or QUICK.
If this option is used, mysqld will on open check if the table
is marked as crashed or if if the table wasn't closed properly
(The last option only works if you are running with --skip-lock-
ing). If this is the case mysqld will run check on the table. If
the table was corrupted, mysqld will attempt to repair it. The
following options affects how the repair works. DEFAULT The
same as not giving any option to --myisam-recover. BACKUP If
the data table was changed during recover, save a backup of the
`table_name.MYD' data file as `table_name-datetime.BAK'. FORCE
Run recover even if we will loose more than one row from the
.MYD file. QUICK Don't check the rows in the table if there
isn't any delete blocks. Before a table is automaticly
repaired, mysqld will add a note about this in the error log. If
you want to be able to recover from most things without user
intervention, you should use the options BACKUP,FORCE. This will
force a repair of a table even if some rows would be deleted,
but it will keep the old data file as a backup so that you can
later examine what happened.

--pid-file=path
Path to pid file used by mysqld_safe.

-P|--port=...
Port number to listen for TCP/IP connections.

-o|--old-protocol
Use the 3.20 protocol for compatibility with some very old
clients. See Mysql Manual section 4.17.3 Upgrading from Version
3.20 to Version 3.21.

--one-thread
Only use one thread (for debugging under Linux). See Mysql Man-
ual section H.1 Debugging a MySQL server.

-O| --set-variable var=option
Give a variable a value. --help lists variables. You can find a
full description for all variables in the SHOW VARIABLES section
in this manual. See Mysql Manual section 7.28.4 SHOW VARIABLES.
The tuning server parameters section includes information of how
to optimize these. See Mysql Manual section 12.2.3 Tuning
Server Parameters.

-Sg|--skip-grant-tables
This option causes the server not to use the privilege system at
all. This gives everyone full access to all databases! (You can
tell a running server to start using the grant tables again by
executing mysqladmin flush-privileges or mysqladmin reload.)

--safe-mode
Skip some optimize stages. Implies --skip-delay-key-write.

--secure
IP numbers returned by the gethostbyname() system call are
checked to make sure they resolve back to the original hostname.
This makes it harder for someone on the outside to get access by
pretending to be another host. This option also adds some sanity
checks of hostnames. The option is turned off by default in
MySQL Version 3.21 because sometimes it takes a long time to
perform backward resolutions. MySQL Version 3.22 caches host-
names (unless --skip-host-cache is used) and has this option
enabled by default.

--skip-concurrent-insert
Turn off the ability to select and insert at the same time on
MyISAM tables. (This is only to be used if you think you have
found a bug in this feature).

--skip-delay-key-write
Ignore the delay_key_write option for all tables. See Mysql Man-
ual section 12.2.3 Tuning Server Parameters.

--skip-locking
Don't use system locking. To use isamchk or myisamchk you must
shut down the server. See Mysql Manual section 1.6 How Stable
Is MySQL?. Note that in MySQL Version 3.23 you can use REPAIR
and CHECK to repair/check MyISAM tables.

--skip-name-resolve
Hostnames are not resolved. All Host column values in the grant
tables must be IP numbers or localhost.

--skip-networking
Don't listen for TCP/IP connections at all. All interaction with
mysqld must be made via Unix sockets. This option is highly rec-
ommended for systems where only local requests are allowed. How-
ever, this option is unsuitable for systems that use
MIT-pthreads, because the MIT-pthreads package doesn't support
Unix sockets.

--skip-new
Don't use new, possible wrong routines. Implies
--skip-delay-key-write

--skip-host-cache
Never use host name cache for faster name-ip resolution, but
query DNS server on every connect instead.

--skip-show-database
Don't allow 'SHOW DATABASE' commands, unless the user has
process privilege.

--skip-thread-priority
Disable using thread priorities for faster response time.

--socket=path
Socket file to use for local connections instead of default
/tmp/mysql.sock.

-t|--tmpdir=path
Path for temporary files. It may be useful if your default /tmp
directory resides on a partition too small to hold temporary
tables.

-u|--user=user_name
Run mysqld daemon as user user_name. This option is mandatory
when starting mysqld as root.

-V|--version
Output version information and exit.


NOTE
SEE ALSO
isamchk(1), isamlog(1), mysql(1), mysqlaccess(1), mysqladmin(1),
mysqld_multi(1), mysqld_safe(1), mysqldump(1), mysql_fix_privi-
lege_tables(1), mysqlshow(1), mysql_zap(1), perror(1), replace(1)

For more information please refer to the MySQL reference manual, which
may already be installed locally and which is also available online at
http://dev.mysql.com/doc/mysql/en 
Technical Details
Message-ID: <eanktq$8jl$5@news.yaako.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.cn99.com!news.yaako.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 101948,2d57ef52457bd009,start
X-Google-Attributes: gid101948,public
X-Google-Language: ENGLISH,GB
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.cn99.com!news.yaako.com!not-for-mail
From: Charlie & <sinox2006@sohu.com>
Newsgroups: cn.bbs.comp.database
Subject: 安装mysql
Date: Tue, 01 Aug 2006 21:27:08 +0000
Organization: sinox
Lines: 1227
Message-ID: <eanktq$8jl$5@news.yaako.com>
Reply-To: sinox2006@sohu.com
NNTP-Posting-Host: 58.59.218.165
Mime-Version: 1.0
Content-Type: text/plain; charset=gb2312
Content-Transfer-Encoding: 8Bit
X-Trace: news.yaako.com 1154438907 8821 58.59.218.165 (1 Aug 2006 13:28:27 GMT)
X-Complaints-To: usenet@news.yaako.com
NNTP-Posting-Date: Tue, 1 Aug 2006 13:28:27 +0000 (UTC)
User-Agent: KNode/0.9.2