当前位置: 数据库>mysql
mysql自动化安装脚本(ubuntu and centos64)
来源: 互联网 发布时间:2014-10-14
本文导语: Ubuntu Mysql自动化安装脚本 代码如下: #/bin/bash function hasDpkg { r=`dpkg -l | grep "$1"` if [ -n "$r" ] then h=`dpkg -l | grep "ii $1"` if [ -n "$h" ] then return 1 else return 0 fi else return 0 fi } mysql="mysql-server-5.5" hasDpkg $mysql r=$? if [ $r -eq 1 ] then : # echo "$mysql...
Ubuntu Mysql自动化安装脚本
#/bin/bash
function hasDpkg
{
r=`dpkg -l | grep "$1"`
if [ -n "$r" ]
then
h=`dpkg -l | grep "ii $1"`
if [ -n "$h" ]
then
return 1
else
return 0
fi
else
return 0
fi
}
mysql="mysql-server-5.5"
hasDpkg $mysql
r=$?
if [ $r -eq 1 ]
then
:
# echo "$mysql was installed"
else
echo "$mysql was not installed"
echo mysql-server mysql-server/root_password password adv | sudo debconf-set-selections
echo mysql-server mysql-server/root_password_again password adv | sudo debconf-set-selections //设定root 用户及其密码
apt-get install $mysql
fi
CentOS64 mysql 自动化安装脚本
#/bin/bash
function hasinstall
{
r=$(rpm -qa "$1")
if [ $r ]
then
return 1
else
return 0
fi
}
mysql="mysql-server"
hasinstall $mysql
r=$?
if [ $r -eq 1 ]
then
:
echo "$mysql was installed"
else
echo "$mysql was not installed"
yum install mysql mysql-server mysql-devel
service mysqld start
fi
#add User to Mysql database
echo "INFORM:Enter database root password"
mysql -uroot -p -hlocalhost
紧急求救!!!!如何在shell脚本中,执行对mysql的操作
如何后台运行mysql脚本?谢谢
哪位有shell写的mysql备份脚本阿,想借鉴看下,谢谢
mysql下怎样运行脚本以运行niuzi.sql为例
把mysql查询结果保存到文件的shell脚本
使用Linux的Shell脚本定时处理MySQL超时
MySQL 脚本开发工具 MyQuery
Linux自动备份MySQL数据库脚本代码
用sh脚本备份mysql的文件打不开
利用Shell脚本实现远程MySQL自动查询
centos中mysql备份数据库脚本分享
shell脚本监控mysql主从状态
用shell脚本在mysql表中批量插入数据的方法
我已经用源代码方式安装了apache,如何让它支持php和mysql(php没有安装,mysql安装的是rpm包),要不要重新安装apache?如何删除已有的ap
iis7站长之家
Python Mysql自动备份脚本
shell脚本中设置mysql记录分隔符为回车
PHP处理SQL脚本文件导入到MySQL的代码实例
实现MySQL定时批量检查表repair和优化表optimize table的shell脚本
linux下如何用C脚本连接访问MYSQL
代码如下:
#/bin/bash
function hasDpkg
{
r=`dpkg -l | grep "$1"`
if [ -n "$r" ]
then
h=`dpkg -l | grep "ii $1"`
if [ -n "$h" ]
then
return 1
else
return 0
fi
else
return 0
fi
}
mysql="mysql-server-5.5"
hasDpkg $mysql
r=$?
if [ $r -eq 1 ]
then
:
# echo "$mysql was installed"
else
echo "$mysql was not installed"
echo mysql-server mysql-server/root_password password adv | sudo debconf-set-selections
echo mysql-server mysql-server/root_password_again password adv | sudo debconf-set-selections //设定root 用户及其密码
apt-get install $mysql
fi
CentOS64 mysql 自动化安装脚本
代码如下:
#/bin/bash
function hasinstall
{
r=$(rpm -qa "$1")
if [ $r ]
then
return 1
else
return 0
fi
}
mysql="mysql-server"
hasinstall $mysql
r=$?
if [ $r -eq 1 ]
then
:
echo "$mysql was installed"
else
echo "$mysql was not installed"
yum install mysql mysql-server mysql-devel
service mysqld start
fi
#add User to Mysql database
echo "INFORM:Enter database root password"
mysql -uroot -p -hlocalhost