如何安装mysql-5.5.31
2013-03-06根据自己的操作系统,选择对应的mysql安装包。
一、windows如何安装mysql-5.5.31-win32.zip
1、解压缩,比如到d:\,为了方便,改一下路径,比如mysql
2、开始/运行,输入cmd,回车进入命令行
d:
cd mysql\bin
安装mysql服务
mysqld.exe --install (默认服务名称是mysql或者mysqld.exe --install "mysql5"修改服务名称)
删除mysql服务
mysqld.exe --remove(或者mysqld.exe --remove "mysql5")
3、ini参数配置文件d:\mysql\
复制mysql-small.ini为my.ini
4、启动停止服务
a)在命令行启动/停止
net start mysql
net stop mysql
b)或者去控制面板找服务启动
c)或者开始/运行输入services.msc,确定后,找到mysql启动
二、linux如何用源码安装mysql-5.5.31.tar.gz
安装编译环境
#!/bin/bash
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zli
b-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 k
rb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers bison lynx
#!/bin/bash
#wget http://www.cmake.org/files/v2.8/cmake-2.8.8.tar.gz
#wget ftp://61.135.158.279/pub/mysql-5.5.31.tar.gz
export LNMP=/opt/LNMP
cd $LNMP
tar zxf untar/cmake-2.8.8.tar.gz
pushd cmake-2.8.8
./bootstrap && gmake && gmake install
popd
groupadd mysql
useradd -g mysql mysql
mkdir -p /usr/local/mysql
mkdir -p /var/lib/mysql
chown -R mysql.mysql /usr/local/mysql
chown -R mysql.mysql /var/lib/mysql
tar zxf untar/mysql-5.5.31.tar.gz
#basename mysql-5.5.31.tar.gz
pushd mysql-5.5.31
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS:STRING=all \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_DATADIR=/var/lib/mysql \
-DMYSQL_USER=mysql
make;
make install;
popd
#cp untar/conf/my.cnf /usr/local/mysql/
cp /opt/LNMP/mysql-5.5.31/support-files/my-large.cnf /usr/local/mysql/my.cnf
cp /opt/LNMP/mysql-5.5.31/support-files/mysql.server /etc/init.d/mysqld
cd /usr/local/mysql
./scripts/mysql_install_db --datadir=/var/lib/mysql --user=mysql
chmod +x /etc/init.d/mysqld
chkconfig mysqld on
/etc/init.d/mysqld start
./bin/mysqladmin -u root password '123456'
#./bin/mysqld_safe &
netstat -ntlp |grep 3306
cat >> ~/.bash_profile << EOF export PATH=$PATH:/usr/local/mysql/bin EOF source ~/.bash_profile cat >> /etc/ld.so.conf.d/mysql.conf << EOF /usr/local/mysql/lib EOF cat >> ~/my.sh << EOF mysql -uroot -p123456 -Dmysql EOF chmod 755 ~/my.sh #删除不必要的用户 mysql -uroot -p123456 -e"drop user ''@'localhost'" mysql -uroot -p123456 -e"drop user ''@'`hostname`'" mysql -uroot -p123456 -e"drop user 'root'@'`hostname`'" mysql -uroot -p123456 -e"drop user root@'::1'" #创建数据库 mysql -uroot -p123456 -e"create database postfix" #创建用户 mysql -uroot -p123456 -e"CREATE USER 'postfix'@'localhost' IDENTIFIED BY '123456';" mysql -uroot -p123456 -e"GRANT ALL ON postfix.* TO 'postfix'@'localhost';" #让创建的用户生效 mysql -uroot -p123456 -e"commit" mysql -uroot -p123456 -e"flush privileges;"
分类:Linux、数据库 | 标签: database、mysql、windows |相关日志
- oracle中drop一个表,让数据文件释放空间
- oracle批量杀掉死锁进程
- ORA-00257: archiver error. Connect internal only, until freed. (DBD ERROR: OCISessionBegin)
- oracle同义词SYNONYM
- substr()函数
- oracle create dblink
- oracle 启动归档模式
- oracle表空间文件
- linux删除oracle表空间文件后空间不释放
- nagios check_oracle_health install shell
- oracle最大连接数processes
- nagios check_oracle_health
- cx_Oracle for python
- 数据库查询重复行shell脚本
- oracle导入txt数据文件实例
- mysql导入txt数据文件实例
- 修改NLS_CHARACTERSET和NLS_NCHAR_CHARACTERSET字符集
- NLS_NCHAR_CHARACTERSET和NLS_CHARACTERSET的区别
- 如何安装mysql-5.6.12
- 设置NLS_LANG环境变量
- Oracle Golden Gate数据库同步技术
- mysql或oracle合并行函数
- Oracle InstantClient安装步骤
- shell sqlplus run sql
- oracle误删datafile
- mysqld_safe — MySQL Server Startup Script
- 如何禁用mysql端口3306
- oracle触发器实例 (8)
- sql语句处理BLOB (8)
- Drizzle A database for the Cloud (1)
- SGA/PGA的设置与调整 (9)
- 根据v$SGA_TARGET_ADVICE设置SGA SIZE (6)
- shmmax/shmall和sga_max_size/sga_target应该设置多大 (3)
- exp/imp和expdp/impdp的逻辑哲学 (1)
- oracle安装后期stop big port (1)
- OLTP和OLAP的区别 (3)
- mysql创建数据库及用户 (1)
- Mysql分支MariaDB简介 (6)
- ORA-01843: not a valid month (3)
- sql语句where 1=1和1=2的作用 (4)
- rlwrap实现sqlplus使用上下键查历史命令
- CentOS_x64_6.3 install Oracle 10.2.0.1报错ins_emdb.mk (2)