平台实施文档6数据库安装配置手册MySQL For SuSE Linux 100.docx
- 文档编号:8234303
- 上传时间:2023-01-30
- 格式:DOCX
- 页数:12
- 大小:219.38KB
平台实施文档6数据库安装配置手册MySQL For SuSE Linux 100.docx
《平台实施文档6数据库安装配置手册MySQL For SuSE Linux 100.docx》由会员分享,可在线阅读,更多相关《平台实施文档6数据库安装配置手册MySQL For SuSE Linux 100.docx(12页珍藏版)》请在冰豆网上搜索。
平台实施文档6数据库安装配置手册MySQLForSuSELinux100
车险信息共享平台MySQL的安装和配置
1.获取MySQLServer和Client
首先,从相关网站获取MySQLCommunityServer5.0的linux版本SuSELinuxEnterpriseServer9RPM(x86)downloads的Server和SuSELinuxEnterpriseServer9RPM(x86)downloads的Client。
放到/root/Desktop目录下。
在客户PC上由可视化工具进行操作,这里使用Xmanager2.0进行操作。
进入/root/Desktop目录,执行ls命令,显示如下:
图1.1
2.安装MySQLServer和Client
执行下面命令进行MySQLServer和MySQL的Client的安装,安装过程显示如下。
rpm-ivhMySQL-server-standard-5.0.27-0.sles9.i586.rpm
rpm-ivhMySQL-client-standard-5.0.27-0.sles9.i586.rpm
图2.1
3.修改root原始密码
将MySQL的root的原始密码空改为root,执行“mysqladmin-urootpasswordroot”;登录MySQL可以执行“mysql-hlocalhost-uroot–proot”。
图3.1
4.查看现有用户
查看现有用户,登录MySQL后执行“selecthost,userfrommysql.user;”
图4.1
5.删除匿名用户
删除匿名用户,执行“deletefrommysql.userwhereuser='';”再执行flushprivileges;然后查看现有用户。
图5
6.添加新用户
添加新用户,执行“GRANTALLPRIVILEGESON*.*TO'sinoiact'@'localhost'IDENTIFIEDBY'password'WITHGRANTOPTION;”和“GRANTALLPRIVILEGESON*.*TO'sinoiact'@'%'IDENTIFIEDBY'password'WITHGRANTOPTION;”。
然后再查看用户显示如下:
图6
7.服务参数配置
启动服务:
servicemysqlstart
停止服务:
servicemysqlstop或者mysqladminshutdown–uroot–proot
同时,根据medium的配置得到环境参数:
/var/lib/mysql/f,如下。
#ThefollowingoptionswillbepassedtoallMySQLclients
[client]
default-character-set=gbk
#password=your_password
port=3306
socket=/var/lib/mysql/mysql.sock
#Herefollowsentriesforsomespecificprograms
#TheMySQLserver
[mysqld]
default-character-set=gbk
default-storage-engine=INNODB
max_connections=80
port=3306
socket=/var/lib/mysql/mysql.sock
skip-locking
key_buffer=16M
max_allowed_packet=1M
table_cache=64
sort_buffer_size=512K
net_buffer_length=8K
read_buffer_size=256K
read_rnd_buffer_size=512K
myisam_sort_buffer_size=8M
#Don'tlistenonaTCP/IPportatall.Thiscanbeasecurityenhancement,
#ifallprocessesthatneedtoconnecttomysqldrunonthesamehost.
#AllinteractionwithmysqldmustbemadeviaUnixsocketsornamedpipes.
#NotethatusingthisoptionwithoutenablingnamedpipesonWindows
#(viathe"enable-named-pipe"option)willrendermysqlduseless!
#
#skip-networking
#ReplicationMasterServer(default)
#binaryloggingisrequiredforreplication
log-bin=mysql-bin
#requireduniqueidbetween1and2^32-1
#defaultsto1ifmaster-hostisnotset
#butwillnotfunctionasamasterifomitted
server-id=1
#ReplicationSlave(commentoutmastersectiontousethis)
#
#Toconfigurethishostasareplicationslave,youcanchoosebetween
#twomethods:
#
#1)UsetheCHANGEMASTERTOcommand(fullydescribedinourmanual)-
#thesyntaxis:
#
#CHANGEMASTERTOMASTER_HOST=
#MASTER_USER=
#
#whereyoureplace
#
#
#Example:
#
#CHANGEMASTERTOMASTER_HOST='125.564.12.1',MASTER_PORT=3306,
#MASTER_USER='joe',MASTER_PASSWORD='secret';
#
#OR
#
#2)Setthevariablesbelow.However,incaseyouchoosethismethod,then
#startreplicationforthefirsttime(evenunsuccessfully,forexample
#ifyoumistypedthepasswordinmaster-passwordandtheslavefailsto
#connect),theslavewillcreateamaster.infofile,andanylater
#changeinthisfiletothevariables'valuesbelowwillbeignoredand
#overriddenbythecontentofthemaster.infofile,unlessyoushutdown
#theslaveserver,deletemaster.infoandrestarttheslaverserver.
#Forthatreason,youmaywanttoleavethelinesbelowuntouched
#(commented)andinsteaduseCHANGEMASTERTO(seeabove)
#
#requireduniqueidbetween2and2^32-1
#(anddifferentfromthemaster)
#defaultsto2ifmaster-hostisset
#butwillnotfunctionasaslaveifomitted
#server-id=2
#
#Thereplicationmasterforthisslave-required
#master-host=
#
#Theusernametheslavewilluseforauthenticationwhenconnecting
#tothemaster-required
#master-user=
#
#Thepasswordtheslavewillauthenticatewithwhenconnectingto
#themaster-required
#master-password=
#
#Theportthemasterislisteningon.
#optional-defaultsto3306
#master-port=
#
#binarylogging-notrequiredforslaves,butrecommended
#log-bin=mysql-bin
#Pointthefollowingpathstodifferentdedicateddisks
#tmpdir=/tmp/
#log-update=/path-to-dedicated-directory/hostname
#UncommentthefollowingifyouareusingBDBtables
#bdb_cache_size=4M
#bdb_max_lock=10000
#UncommentthefollowingifyouareusingInnoDBtables
innodb_data_home_dir=/var/lib/mysql/
innodb_data_file_path=ibdata1:
10M:
autoextend
innodb_log_group_home_dir=/var/lib/mysql/
innodb_log_arch_dir=/var/lib/mysql/
#Youcanset.._buffer_pool_sizeupto50-80%
#ofRAMbutbewareofsettingmemoryusagetoohigh
innodb_buffer_pool_size=16M
innodb_additional_mem_pool_size=2M
#Set.._log_file_sizeto25%ofbufferpoolsize
innodb_log_file_size=5M
innodb_log_buffer_size=8M
innodb_flush_log_at_trx_commit=1
innodb_lock_wait_timeout=50
[mysqldump]
quick
max_allowed_packet=16M
[mysql]
default-character-set=gbk
no-auto-rehash
#RemovethenextcommentcharacterifyouarenotfamiliarwithSQL
#safe-updates
[isamchk]
key_buffer=20M
sort_buffer_size=20M
read_buffer=2M
write_buffer=2M
[myisamchk]
key_buffer=20M
sort_buffer_size=20M
read_buffer=2M
write_buffer=2M
[mysqlhotcopy]
interactive-timeout
8.创建数据库
创建数据库sinoiact,执行“CREATEDATABASEsinoiactDEFAULT CHARACTERSETgbkDEFAULT COLLATEgbk_chinese_ci;”
然后显示所有数据库如下:
图7
到此,在linux上创建数据库完毕。
接下来,在客户端PC上使用MySQLAdministrator进行相关操作
图8
9.给用户赋予权限
登录后,选择UserAdministration,在下面选中sinoiact用户,在右边选中sinoiact数据库,再给它完全的权限(把所有的availableprivileges都加到assignedprivileges中)。
图9
10.建表及加载初始化数据
然后在客户PC上,执行附件中的脚本:
sinoiact_mysql.cmd来建表及加载初始化数据,选择Catalogs的SchemaTables,点击Refresh,显示如下
图10
到此,在SuSELinux上MySQL的安装、配置、建库、建表、导入初始化数据、连接、测试已经完成。
相关说明:
关于建表和加载初始化数据的附件脚本,不同的环境下,只需要编辑sinoiact_mysql.cmd即可:
将IP该换成MySQLServer所在的服务器IP,-u和-p后面所对应的是数据库sinoiact的用户的用户名和密码。
注意事项:
1、安装MySQL前,应关闭linux系统自带防火墙,否则在PC上会出现MySQLAdministrator连接错误(10060)。
2、在Linux中,库名是区分大小写的。
所以使用useSinoiact是不可以的,必须使用usesinoiact。
相关网站:
1、MySQL镜象地址:
http:
//mysql.justdn.org/downloads/mysql/5.0.html
2、Server下载地址:
http:
//mysql.justdn.org/Downloads/MySQL-5.0/MySQL-server-standard-5.0.27-0.sles9.i586.rpm
3、Client下载地址:
http:
//mysql.justdn.org/Downloads/MySQL-5.0/MySQL-client-standard-5.0.27-0.sles9.i586.rpm
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 平台实施文档6数据库安装配置手册MySQL For SuSE Linux 100 平台 实施 文档 数据库 安装 配置 手册 MySQL