1、5. 删除匿名用户删除匿名用户,执行“delete from mysql.user where user = ;” 再执行flush privileges;然后查看现有用户。图56. 添加新用户添加新用户,执行“GRANT ALL PRIVILEGES ON *.* TO sinoiactlocalhost IDENTIFIED BY password WITH GRANT OPTION;”和“GRANT ALL PRIVILEGES ON *.* TO % ”。然后再查看用户显示如下:图67. 服务参数配置启动服务:service mysql start停止服务:service mysql
2、stop 或者mysqladmin shutdown u root proot 同时,根据medium的配置得到环境参数:/var/lib/mysql/f,如下。# The following options will be passed to all MySQL clientsclientdefault-character-set=gbk#password = your_passwordport = 3306socket = /var/lib/mysql/mysql.sock# Here follows entries for some specific programs# The MySQ
3、L servermysqlddefault-storage-engine=INNODBmax_connections=80skip-lockingkey_buffer = 16Mmax_allowed_packet = 1Mtable_cache = 64sort_buffer_size = 512Knet_buffer_length = 8Kread_buffer_size = 256Kread_rnd_buffer_size = 512Kmyisam_sort_buffer_size = 8M# Dont listen on a TCP/IP port at all. This can b
4、e a security enhancement,# if all processes that need to connect to mysqld run on the same host.# All interaction with mysqld must be made via Unix sockets or named pipes.# Note that using this option without enabling named pipes on Windows# (via the enable-named-pipe option) will render mysqld usel
5、ess!# #skip-networking# Replication Master Server (default)# binary logging is required for replicationlog-bin=mysql-bin# required unique id between 1 and 232 - 1# defaults to 1 if master-host is not set# but will not function as a master if omittedserver-id = 1# Replication Slave (comment out maste
6、r section to use this)# To configure this host as a replication slave, you can choose between# two methods :# 1) Use the CHANGE MASTER TO command (fully described in our manual) -# the syntax is:# CHANGE MASTER TO MASTER_HOST=, MASTER_PORT=,# MASTER_USER=, MASTER_PASSWORD= ;# where you replace , by
7、quoted strings and# by the masters port number (3306 by default).# Example:# CHANGE MASTER TO MASTER_HOST=125.564.12.1, MASTER_PORT=3306,# MASTER_USER=joe, MASTER_PASSWORD=secret# OR# 2) Set the variables below. However, in case you choose this method, then# start replication for the first time (eve
8、n unsuccessfully, for example# if you mistyped the password in master-password and the slave fails to# connect), the slave will create a master.info file, and any later# change in this file to the variables values below will be ignored and# overridden by the content of the master.info file, unless y
9、ou shutdown# the slave server, delete master.info and restart the slaver server.# For that reason, you may want to leave the lines below untouched# (commented) and instead use CHANGE MASTER TO (see above)# required unique id between 2 and 232 - 1# (and different from the master)# defaults to 2 if ma
10、ster-host is set# but will not function as a slave if omitted#server-id = 2# The replication master for this slave - required#master-host = # The username the slave will use for authentication when connecting# to the master - required#master-user = # The password the slave will authenticate with whe
11、n connecting to# the master - required#master-password = # The port the master is listening on.# optional - defaults to 3306#master-port = # binary logging - not required for slaves, but recommended#log-bin=mysql-bin# Point the following paths to different dedicated disks#tmpdir = /tmp/ #log-update
12、= /path-to-dedicated-directory/hostname# Uncomment the following if you are using BDB tables#bdb_cache_size = 4M#bdb_max_lock = 10000# Uncomment the following if you are using InnoDB tablesinnodb_data_home_dir = /var/lib/mysql/innodb_data_file_path = ibdata1:10M:autoextendinnodb_log_group_home_dir =
13、 /var/lib/mysql/innodb_log_arch_dir = /var/lib/mysql/# You can set ._buffer_pool_size up to 50 - 80 %# of RAM but beware of setting memory usage too highinnodb_buffer_pool_size = 16Minnodb_additional_mem_pool_size = 2M# Set ._log_file_size to 25 % of buffer pool sizeinnodb_log_file_size = 5Minnodb_l
14、og_buffer_size = 8Minnodb_flush_log_at_trx_commit = 1innodb_lock_wait_timeout = 50mysqldumpquickmax_allowed_packet = 16Mmysqlno-auto-rehash# Remove the next comment character if you are not familiar with SQL#safe-updatesisamchkkey_buffer = 20Msort_buffer_size = 20Mread_buffer = 2Mwrite_buffer = 2Mmy
15、isamchkmysqlhotcopyinteractive-timeout8. 创建数据库创建数据库 sinoiact,执行“CREATE DATABASE sinoiact DEFAULT CHARACTER SET gbk DEFAULT COLLATE gbk_chinese_ci;然后显示所有数据库如下:图7到此,在linux上创建数据库完毕。接下来,在客户端PC上使用MySQL Administrator进行相关操作图89. 给用户赋予权限登录后,选择User Administration,在下面选中sinoiact用户,在右边选中sinoiact数据库,再给它完全的权限(把所有的
16、available privileges都加到assigned privileges中)。图910. 建表及加载初始化数据然后在客户PC上,执行附件中的脚本:sinoiact_mysql.cmd来建表及加载初始化数据,选择Catalogs的Schema Tables,点击Refresh,显示如下图10到此,在SuSE Linux上MySQL的安装、配置、建库、建表、导入初始化数据、连接、测试已经完成。相关说明:关于建表和加载初始化数据的附件脚本,不同的环境下,只需要编辑sinoiact_mysql.cmd即可:将IP该换成MySQL Server所在的服务器IP,-u和-p后面所对应的是数据库
17、sinoiact的用户的用户名和密码。注意事项:1、 安装MySQL前,应关闭linux系统自带防火墙,否则在PC上会出现MySQL Administrator连接错误(10060)。2、 在Linux中,库名是区分大小写的。所以使用 use Sinoiact是不可以的,必须使用use sinoiact。相关网站:1、MySQL镜象地址:http:/mysql.justdn.org/downloads/mysql/5.0.html2、Server下载地址:/mysql.justdn.org/Downloads/MySQL-5.0/MySQL-server-standard-5.0.27-0.sles9.i586.rpm3、Client 下载地址:/mysql.justdn.org/Downloads/MySQL-5.0/MySQL-client-standard-5.0.27-0.sles9.i586.rpm
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1