当前位置: 首页 > wzjs >正文

网站设计公司的推广外贸网站seo怎么做

网站设计公司的推广,外贸网站seo怎么做,wordpress 4.9.6 主题,网站项目分析怎么做 方法实现功能 增 数据库的创建,数据表的创建已经实现 创建用户 删 删除数据库, 删除库下的某个表, 删除某个用户 改 暂无 查 查看所有的数据库, 查看某个库下的所有数据表, 查看某个表的结构, 查…

实现功能

数据库的创建,数据表的创建已经实现

创建用户

删除数据库,

删除库下的某个表,

删除某个用户

暂无

查看所有的数据库,

查看某个库下的所有数据表,

查看某个表的结构,

查看某个库的某个表中的所有数据,

查看所有用户

后续计划

准备添加向表中插入数据,包含一次插入多条数据,一次对某列或者多列插入数据

修改某表中的数据

删除表中数据

代码展示

#!/bin/bash
#登录mysql
menu() {
echo -e "\e[32m\t1--查看所有可用数据库\e[0m"
echo -e "\e[32m\t2--查看某个数据库下所有的数据表\e[0m"
echo -e "\e[32m\t3--查看某个库下某个表的结构\e[0m"
echo -e "\e[32m\t4--查看某个库下的某个表中的所有数据\e[0m"
echo -e "\e[32m\t5--创建一个数据库\e[0m"
echo -e "\e[32m\t6--在某个数据库下创建一个数据表\e[0m"
echo -e "\e[32m\t7--在表中插入数据\e[0m"
echo -e "\e[32m\t8--创建一个用户\e[0m"
echo -e "\e[32m\t9--删除数据库\e[0m"
echo -e "\e[32m\t10--删除某个数据库下的数据表\e[0m"
echo -e "\e[32m\t11--删除某个用户信息\e[0m"
echo -e "\e[32m\t12--查看所有用户\e[0m"
echo -e "\e[32m\t13--退出\e[0m"
echo -e "\e[32m\t14--待补充\e[0m"
echo -e "\e[32m\t15--待补充\e[0m"
}
test_db(){
mysql -u${mysql_user:-root} -p"${mysql_password}" -h ${mysql_host:-localhost} -P${mysql_port:-3306} -e "exit" &> /dev/null
if [ $? -eq 0 ];thenecho -e  "\e[32m登录成功,当前数据库信息正确,数据库可以使用\e[0m"echo -e  "\e[35m<-------------------------------------------------------->\e[0m"
elseecho  -e "\e[31m登录失败,数据库用户或密码错误,请重新进行信息收集\e[0m"exit
fi
}
useage() {
echo -e "\e[33m请输入选项1-15\e[0m"
}
date() {
sleep 0.5
}
get_message() {echo -e "\e[33m请先进行数据库登录!!!\e[0m"read -p "请输入你要使用的用户(默认为root):" mysql_usermysql_user=${mysql_user:-root}read -sp "请输入用户密码:"  mysql_passwordecho ""read -p "请输入你要登录的主机(默认为localhost)" mysql_hostmysql_host=${mysql_host:-localhost}read -p "请输入你要登录的服务端口号(默认为3306)" mysql_portmysql_port=${mysql_port:-3306}
}
show_dbs() {
echo -e "\e[32m所有数据库信息如下所示:\e[0m"
date
mysql -u${mysql_user} -p"${mysql_password}" -h ${mysql_host} -P${mysql_port} -e "show databases"  2> /dev/null
}
show_tbs() {
read -p "输入你要查看的数据库名(默认为mysql):" db_name
mysql -u${mysql_user} -p"${mysql_password}" -h ${mysql_host} -P${mysql_port} -e "use ${db_name:-mysql} ; show tables" 
}
show_tb_desc() {
read -p "输入你要查看的数据库(默认为mysql)" db_name 
read -p "输入你要查看的数据表(默认为user)" tb_name
message=${db_name:-mysql}.${tb_name:-user}
mysql -u${mysql_user} -p"${mysql_password}" -h ${mysql_host} -P${mysql_port} -e "desc  $message"
}
select_datas() {
read -p "输入你要查看的数据库(默认为mysql)" db_name 
read -p "输入你要查看的数据表(默认为user)" tb_name
message=${db_name:-mysql}.${tb_name:-user}
mysql -u${mysql_user} -p"${mysql_password}" -h ${mysql_host} -P${mysql_port} -e "select * from $message"
read -p "输入g展示旋转后的数据,输入其他跳过" choice
if [ $choice == 'g' ];then 
mysql -u${mysql_user} -p"${mysql_password}" -h ${mysql_host} -P${mysql_port} -e "select * from $message\G"    
else 
echo -e "\e[33m跳过\e[0m"
fi
}
create_db() {
read -p "输入你要创建的数据库名(默认为dbs)" db_name
read -p "输入你要创建的数据库默认字符集(默认utf8)" character_name
character_name=${character_name:-utf8}
mysql -u${mysql_user} -p"${mysql_password}" -h ${mysql_host} -P${mysql_port} -e "create database if not exists ${db_name:-dbs} default character set $character_name"    
if [ $? -eq 0 ];then echo -e "\e[32m数据库${db_name}创建成功,使用的字符集为"$character_name"\e[0m"dateecho -e  "\e[33m也有可能该数据库已存在,推荐先使用功能9将数据库删除在进行创建\e[0m"
fi
}
create_tb() {
echo "某个库下创建数据表"
read -p "输入你要创建的表名" tb_name
read -p "输入你的创建的表基于的库名" db_name
read -p "输入你的创建的表的默认字符集(默认为utf8)" tb_type
table_message=${db_name:-mysql}.${tb_name:-user}
echo $table_message
read -p "输入你要创建的字段个数" columns_number
for (( i=1; i<=$columns_number; i++ ));doread -p "输入第${i}列的字段名" column_nameread -p "输入第${i}列的数据类型" column_typeread -p "输入第${i}列的约束\n(默认为default null)" column_constraintcolumn_constraint=${column_constraint:-default null}if [ $i -ne $columns_number ] ;thencolumn_message="$column_name $column_type $column_constraint, "column_array[$i]=$column_messageelsecolumn_message="$column_name $column_type $column_constraint"column_array[$i]=$column_messagefidone
echo "所有列的信息为${column_array[@]}"
all_columns="(${column_array[@]})"
mysql -u${mysql_user} -p"${mysql_password}" -h ${mysql_host} -P${mysql_port} -e "create table if not exists $table_message $all_columns;" &> /dev/null && echo -e "\e[32m数据表${table_message}创建完成\e[0m" || echo -e "\e[31m数据表${table_message}创建失败\e[0m"
}
insert_data() {
read -p "输入插入表所属库名(默认为mysql)" db_name
read -p "输入你要插入数据的表名(默认为user)" tb_name
tb_message=${db_name:-mysql}.${tb_name:-user}
array=`mysql -u${mysql_user} "-p${mysql_password}" -h ${mysql_host} -P${mysql_port} -e "desc ${tb_message}"  | grep -v "Extra" | awk '{print $1,$2}'`
flag=0
for i in $array;
do flag=$(( $flag + 1 ))if [ $(($flag % 2)) -eq 1 ];thenecho -e  "\e[35m第$(($(($flag + 1 )) / 2 ))个字段名称为$i\e[0m"else echo -e  "\e[35m第$(($flag / 2))个字段类型为$i\e[0m"fi
done
#数据表中的字段已经可以进行收集,剩下数据插入部分后续进行补充
}
show_users() {
echo "当前已经存在的用户"
list=`mysql -u${mysql_user} -p"${mysql_password}" -h ${mysql_host} -P${mysql_port} -e 'select * from mysql.user\G' | egrep "User|Host" | awk -F":" '{print $NF}'`
number=`mysql -u${mysql_user} -p"${mysql_password}" -h ${mysql_host} -P${mysql_port} -e 'select * from mysql.user\G'  | egrep "User|Host" | awk -F":" '{print $NF}' | wc -l`
for (( i=1; i<=$number; i++ ));
doflag=$((i%2))if [ $flag -eq 1  ] ;thenhost=`echo $list | cut -d" " -f $i`elseuser=`echo $list | cut -d" " -f $i`message=$user@$hostecho $messagefi
done
}
create_user() {
show_users
read -p "输入你要创建的用户名" user_name
read -p "输入用户可登录的主机(默认为localhost)" host_name 
read -sp "输入你要设置的密码(必须符合密码复杂策略,不输入则为默认密码)" password
echo ""
host_name=\'${host_name:-localhost}\'
user_message=$user_name@$host_name
password=\'${password:-'ABCDE2002@'}\'
mysql -u${mysql_user} -p"${mysql_password}" -h ${mysql_host} -P${mysql_port} -e "create user ${user_message} identified by ${password};" &> /dev/null && echo -e "\e[32m用户${user_message}创建成功\e[0m"  || echo -e  "\e[31m用户${user_message}创建失败\e[0m"   
}
drop_db() {
read -p "输入你要删除的数据库" db_name 
mysql -u${mysql_user} -p"${mysql_password}" -h ${mysql_host} -P${mysql_port} -e "drop database if exists $db_name;" &> /dev/null
if [ $? -eq 0 ];thenecho -e "\e[32m数据库${db_name}成功删除\e[0m"dateecho -e "\e[33m数据库${db_name}也可能本身就不存在\e[0m" 
fi
}
drop_tb() {
read -p "输入你要删除的数据表所在的数据库" db_name
read -p "输入你要删除的数据表" tb_name
drop_message=$db_name.$tb_name
mysql -u${mysql_user} -p"${mysql_password}" -h ${mysql_host} -P${mysql_port} -e "drop table if exists $drop_message;" &> /dev/null
if [ $? -eq 0 ];thenecho -e "\e[32m数据表${drop_message}成功删除\e[0m"dateecho -e "\e[33m数据表${drop_message}也可能本身就不存在\e[0m" 
fi
}
drop_user() {
show_users
read -p "输入你要删除的用户名" user_name
read -p "输入你要删除的用户主机(默认为localhost)" host_name
host_name=\'${host_name:-localhost}\'
user_message=$user_name@$host_name
echo $message
mysql -u${mysql_user} -p"${mysql_password}" -h ${mysql_host} -P${mysql_port} -e "drop user if exists $user_message;" &> /dev/null && echo -e "\e[32m用户${user_message}删除成功\e[0m"
}
main() {
get_message
test_db
while true;domenuread -p "输入你要使用的功能" choicecase $choice in 1) show_dbsdate;;2) show_tbsdate;;3) show_tb_descdate;;4) select_datasdate;;5) create_dbdate;;6) create_tbdate;;7) insert_datadate;;8) create_userdate;;9) drop_dbdate;;10) drop_tbdate;;11) drop_userdate;;12) show_usersdate;;13) break;;14) echo "待补充";;15) echo "待补充"date;;*)useagedate;;esac 
done
}
main


文章转载自:

http://o2Lnd005.mrttc.cn
http://RdSYI0ql.mrttc.cn
http://M7xN6BzK.mrttc.cn
http://VfVNwtax.mrttc.cn
http://2RkX3zsQ.mrttc.cn
http://C9dAnZIc.mrttc.cn
http://byO61kaf.mrttc.cn
http://MqahhYid.mrttc.cn
http://e3zAUa2b.mrttc.cn
http://BYK46GqD.mrttc.cn
http://ZQIsT8Rv.mrttc.cn
http://Rc2ZKvUY.mrttc.cn
http://QvJjVHEC.mrttc.cn
http://IIbSpSRo.mrttc.cn
http://Q7TZ0DSK.mrttc.cn
http://2eberYV7.mrttc.cn
http://ParJwcZE.mrttc.cn
http://capuQo82.mrttc.cn
http://A3fPoHSZ.mrttc.cn
http://gDJK0EIl.mrttc.cn
http://sCzGAt5V.mrttc.cn
http://Y90WhYB5.mrttc.cn
http://rfrbq07w.mrttc.cn
http://bbBhNSlT.mrttc.cn
http://WnLf17Zh.mrttc.cn
http://U3XH0WyZ.mrttc.cn
http://CwOwDFCd.mrttc.cn
http://WzvCsnZ9.mrttc.cn
http://MNqjLudO.mrttc.cn
http://byZpFySZ.mrttc.cn
http://www.dtcms.com/wzjs/685863.html

相关文章:

  • 江苏德丰建设集团网站天津综合网站建设商店
  • 东营企业自助建站做网站的实践报告
  • 高校网站群建设方案成都文化墙设计公司
  • 乐山网站营销推广哪家公司好无水印做海报的网站
  • 地方门户网站的特点如何建立小程序网站
  • 网站建设厦门同安北京宣传片制作公司
  • 怎么做公司网站的手机客户端网站建设頰算
  • 漂亮的博客网站模板南宁seo推广
  • 一般网站建设中的推广费用阜新本地网站建设平台
  • 自己建网站怎么推广南通专业做网站公司
  • 自适应网站推广做家装施工的网站
  • 厦门无忧网站建设有限公司辽宁建设厅规划设计网站
  • 小企业网站如何建设好江西省建设工程协会网站查询
  • 织梦教育咨询企业网站模板唐山网站托管
  • 杭州企业网站有做阿里网站的吗
  • 建设商城网站wordpress 关于我们页面模板
  • 门户网站制作流程微信电脑版
  • 网站源码如何使用WordPress目录筛选
  • 网站推广话术与技巧新网域名注册官网
  • 南宁网站制作公司哪家好scratch编程免费下载
  • wordpress使用redis桂平seo关键词优化
  • 网站上的销售怎么做检索标准的网站
  • 电子商务网站开发要学什么抖音网红代运营
  • 住房和城乡建设部网站首页网站后台有显示前台没有
  • 商品网站怎么做的烟台莱州网站建设
  • 成都龙泉建设网站赣州网站优化推广
  • 网站建设定义是什么意思wordpress seo title
  • 公司网站备案号廉溪区建设局网站
  • 手机访问网站页面丢失wordpress项目
  • 深圳网站制作收费微信分享接口网站开发