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

自己公司网站设计创业网站怎么做的

自己公司网站设计,创业网站怎么做的,网页制作居中代码,阜蒙县建设小学校官方网站大纲1、安装 MySQL2、检索数据3、数据过滤一、安装环境CentOS-6.5-i386mysql 5.1.73为了方便#xff0c;这里采用yum方式安装#xff0c;对于学习实验环境完全没问题#xff0c;注意下面的操作都以root身份操作。除非对MySQL需要定制化或者安装多个实例#xff0c;建议使用… 大纲1、安装 MySQL2、检索数据3、数据过滤一、安装环境CentOS-6.5-i386mysql 5.1.73为了方便这里采用yum方式安装对于学习实验环境完全没问题注意下面的操作都以root身份操作。除非对MySQL需要定制化或者安装多个实例建议使用YUM/RPM包安装 或者 通用二进制格式安装。源码也有30多M如果编译安装需要花费大量的时间。MySQL被Oracle收购以后分为了以下两个版本Community Edtion MySQL Community ServerEnterprise Edtion MySQL Enterprise ServerMySQL 官方网站提供三种软件包格式软件包管理特有的格式RPM包 DEP包MSI 格式通用二进制格式不需要安装解压并简单配置即可源码文件Source Code二、安装MySQLa、检查系统是否已经安装mysql如果存在则卸载然后重新安装# rpm -qa | grep -i mysql## 查看MySQL相关的安装包 # yum search mysqlb、安装mysql服务器端# yum -y install mysql-serverc、安装mysql客户端程序# yum -y install mysqld、如果需要开发程序那么需要安装mysql开发库。建议安装它# yum -y install mysql-devele、默认情况下MySQL的几个目录数据文件    /var/lib/mysql 可执行文件  /usr/bin (mysql, mysqldump, mysqladmin等命令) 服务启动脚本/etc/init.d/mysqld 配置文件:    /etc/my.cnf安装mysqld    MySQL服务器端的二进制可执行文件mysql       MySQL客户端程序MySQL启动后默认情况下监听在 3306 端口。三、修改配置文件 默认情况下mysql是不支持中文字符的。因为其默认的字符集latin1我们可以通过修改其配置文件来更改默认的字符集设置。默认情况下的字符集如下mysql SHOW VARIABLES LIKE %char%; ------------------------------------------------------ | Variable_name            | Value                      | ------------------------------------------------------ | character_set_client     | latin1                     | | character_set_connection | latin1                     | | character_set_database   | latin1                     | | character_set_filesystem | binary                     | | character_set_results    | latin1                     | | character_set_server     | latin1                     | | character_set_system     | utf8                       | | character_sets_dir       | /usr/share/mysql/charsets/ | ------------------------------------------------------    设置字符集为UTF-8, 编辑配置文件/etc/my.cnf 在[mysqld]下添加如下一行default-character-setutf8四、启动 停止 MySQL 服务a、设置mysql开机启动# chkconfig --add mysqld # chkconfig mysqld on # chkconfig --list | grep mysqlb、启动mysql服务mysq l服务的启动脚本位于 /etc/init.d/mysqld我们可以通过以下方式启动# service mysqld start or # /etc/init.d/mysqld startc、进行必要的安全性设置# /usr/bin/mysql_secure_installation然后根据提示回答yes/no即可。d、重启或停止mysql服务# service mysqld restart     # 重启 # service mysqld stop     # 停止五、连接到 MySQL 服务    MySQL与所有其他客户机-服务器DBMS一样要求在能够执行命令之前登录到DBMS。为了连接到MySQL需要以下信息主机名如果是连接到本地mysql服务器为localhost端口号默认为3306一个合法的mysql用户名用户口令如果需要## 连接 # mysql -h localhost -P 3306 -u root -p -h:host指定主机 -P:Port指定端口 -u:user指定用户名 -p:password## 退出 mysql quit  在连接登录之后就可以访问该用户有权限访问的任意数据库和表了。MySQL 数据库的用户与操作系统用户无关 其用户定义比较特殊 usernamehost   由 用户名 以及 允许该用户登录的源主机 组合而成。a、选择数据库    在最初连接到mysql时没有任何数据库打开供你使用。在你能执行任意数据库操作前需要选择一个数据库。为此可使用USE关键字。例如为了使用test数据库mysql USE test;记住必须先使用USE选择数据库后才能读取其中的数据。b、了解数据库和表    想一想如果你不知道可以使用的数据库名时怎么办数据库、表、用户权限等信息被存储在数据库mysql表中。不过内部的表一般不能直接访问可以mysql的SHOW命令来显示这些信息。查询可用的数据库mysql SHOW DATABASES;获取数据库表的列表mysql USE mysql; mysql SHOW TABLES;查看表结构mysql DESC user;显示授予用户的权限mysql SHOW GRANTS;更多的SHOW命令 请mysql ? SHOW;mysql help contents;六、MySQL客户端工具1MySQL    MySQL是一个简单的SQL外壳(有GNU readline功能)。它支持交互式和非交互式使用。当交互使用时查询结果采用ASCII表格式。当采用非交互式(例如用作过滤器)模式时结果为tab分割符格式。可以使用命令行选项更改输出格式。如果由于结果较大而内存不足遇到问题使用--quick选项。这样可以强制MySQL从服务器每次一行搜索结果而不是检索整个结果集并在显示之前不得不将它保存到内存中。2MySQLAdmin    MySQLAdmin是一个执行管理操作的客户程序。可以用它来检查服务器的配置和当前的状态创建并删除数据库等等。3) MySQLBinLog    服务器生成的二进制日志文件写成二进制格式。要想检查这些文本格式的文件应使用MySQLBinLog实用工具。4) MySQLDumpMySQLDump客户端可用来转储数据库或搜集数据库进行备份或将数据转移到另一个SQL服务器。转储包含创建表和/或装载表的SQL语句。5) MySQLImportMySQLImport实用程序是一个批量加载器它将文本文件的内容读到已有表中。6) MySQLShowMySQLShow,客户可用来很快地查找存在哪些数据库数据库中的表表中的列或索引。7) PerrorPerror为系统错误代码或存储引擎表处理错误代码打印其描述信息。8) ReplaceReplace实用工具可以及时更改文件或标准输入中的字符串。它首先使用有限状态机来匹配长的字符串。该工具可以用来交换字符串。所有客户端工具都受my.cnf配置文件中 [client] 的影响 [mysql] 只会影响mysql客户端工具。所有客户端工具都支持一些通用的选项比如以下这些    --user, -u    --host, -h    --password, -p    --port, -P    --protocol    --database  DATABASE , -DMySQLMySQL客户端提供两种工作模式交互式模式这种模式下又可以执行两类命令客户端命令help 可以查看服务器端命令需要服务端响应的命令必须使用语句结束符默认为 批处理模式执行 mysql 脚本    # mysql init.sql   (输入重定向方式)    mysql  source  /path/to/your.sql   (\.)-------------------让mysql从文件中读取语句----------------- --命令行从sql文件中读取# mysql dbname filename.sql--mysql会话内从sql文件读取source /path/to/filename.sql\.  /path/to/filename.sql1、我们首先看一下mysql 命令的常见选项[rootmysql ~]# mysql --help ... Usage: mysql [OPTIONS] [database]-?, --help          Display this help and exit.-I, --help          Synonym for -?--auto-rehash       Enable automatic rehashing. One doesnt need to userehash to get table and field completion, but startupand reconnecting may take a longer time. Disable with--disable-auto-rehash.(Defaults to on; use --skip-auto-rehash to disable.)-A, --no-auto-rehash No automatic rehashing. One has to use rehash to gettable and field completion. This gives a quicker start ofmysql and disables rehashing on reconnect.--auto-vertical-output Automatically switch to vertical output mode if theresult is wider than the terminal width.-B, --batch         Dont use history file. Disable interactive behavior.(Enables --silent.)-C, --compress      Use compression in server/client protocol.-D, --databasename Database to use.--default-character-setname Set the default character set.--delimitername    Delimiter to be used.-e, --executename  Execute command and quit. (Disables --force and historyfile.)-E, --vertical      Print the output of a query (rows) vertically.-f, --force         Continue even if we get an SQL error.-G, --named-commands Enable named commands. Named commands mean this programsinternal commands; see mysql help . When enabled, thenamed commands can be used from any line of the query,otherwise only from the first line, before an enter.Disable with --disable-named-commands. This option isdisabled by default.--local-infile      Enable/disable LOAD DATA LOCAL INFILE.-h, --hostname     Connect to host.-H, --html          Produce HTML output.-X, --xml           Produce XML output.--line-numbers      Write line numbers for errors.(Defaults to on; use --skip-line-numbers to disable.)-L, --skip-line-numbers Dont write line number for errors.-n, --unbuffered    Flush buffer after each query.-N, --skip-column-names Dont write column names in results.--sigint-ignore     Ignore SIGINT (CTRL-C).--pager[name]      Pager to use to display results. If you dont supply anoption, the default pager is taken from your ENV variablePAGER. Valid pagers are less, more, cat [ filename],etc. See interactive help (\h) also. This option does notwork in batch mode. Disable with --disable-pager. Thisoption is disabled by default.-p, --password[name] Password to use when connecting to server. If password isnot given its asked from the tty.-P, --port#        Port number to use for connection or 0 for default to, inorder of preference, my.cnf, $MYSQL_TCP_PORT,/etc/services, built-in default (3306).--promptname       Set the mysql prompt to this value.--protocolname     The protocol to use for connection (tcp, socket, pipe,memory).-S, --socketname   The socket file to use for connection.-t, --table         Output in table format.--teename          Append everything into outfile. See interactive help (\h)also. Does not work in batch mode. Disable with--disable-tee. This option is disabled by default.-u, --username     User for login if not current user.--connect-timeout# Number of seconds before connection timeout.Default options are read from the following files in the given order: /etc/mysql/my.cnf /etc/my.cnf ~/.my.cnf  The following groups are read: mysql client The following options may be given as the first argument: --print-defaults        Print the program argument list and exit. 查看从配置文件读取哪些选项 --no-defaults           Dont read default options from any option file,except for login file. --defaults-file#       Only read default options from the given file #. --defaults-extra-file# Read this file after the global files are read. --defaults-group-suffix#Also read groups with concat(group, suffix) --login-path#          Read this path from the login file.2、常用客户端命令mysql ?For information about MySQL products and services, visit:http://www.mysql.com/ For developer information, including the MySQL Reference Manual, visit:http://dev.mysql.com/ To buy MySQL Enterprise support, training, or other products, visit:https://shop.mysql.com/List of all MySQL commands: Note that all text commands must be first on line and end with ; ?         (\?) Synonym for help. clear     (\c) Clear the current input statement. connect   (\r) Reconnect to the server. Optional arguments are db and host. delimiter (\d) Set statement delimiter. edit      (\e) Edit command with $EDITOR. ego       (\G) Send command to mysql server, display result vertically. exit      (\q) Exit mysql. Same as quit. go        (\g) Send command to mysql server. help      (\h) Display this help. nopager   (\n) Disable pager, print to stdout. notee     (\t) Dont write into outfile. pager     (\P) Set PAGER [to_pager]. Print the query results via PAGER. print     (\p) Print current command. prompt    (\R) Change your mysql prompt. quit      (\q) Quit mysql. rehash    (\#) Rebuild completion hash. source    (\.) Execute an SQL script file. Takes a file name as an argument. status    (\s) Get status information from the server. system    (\!) Execute a system shell command. tee       (\T) Set outfile [to_outfile]. Append everything into given outfile. use       (\u) Use another database. Takes database name as argument. charset   (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets. warnings  (\W) Show warnings after every statement. nowarning (\w) Dont show warnings after every statement.For server side help, type help contents    \c 清除当前输入的语句提前终止、取消语句执行。前提是 \c 之前没有语句结束符。delimiter 设置语句结束符    \g :  无论语句结束符是什么直接将此语句发送至服务器执行。\G :  无论语句结束符是什么直接将此语句发送至服务器执行,并且结果以竖排方式显示。pager 通过 PAGER 打印查询结果source     \. 执行SQL 脚本status      \s 获取服务器状态system    \! :  执行系统shell 命令rehash    \# :  对新建的对象table name, colume name支持补齐功能命令补齐功能     名称table name, colume name补齐prompt    如果有很多mysql数据库管理有时会发生自己忘记了在那台服务器那台数据库上毋庸多说谁都知道这有多危险。可以使用prompt来重写mysql客户端提示符。mysqlprompt \u\h(\d) \r:\m:\s  \u:连接用户  \h:连接主机  \d:连接数据库  \r:\m:\s:显示当前时间如果嫌每次都在命令行修改麻烦直接修改my.cnf参数 [mysql]    #这是不是[mysqld]    prompt\\u\\d \\R:\\mrootlocalhost((none)) 06:57:39 prompt  Returning to default PROMPT of mysql  mysqlpager    如果select出来的结果集超过几个屏幕那么前面的结果一晃而过无法看到。使用pager可以设置调用os的more或者less等显示查询结果和在os中使用more或者less查看大文件的效果和使用方式都一样。pager [cmd]   cmd 是标准linux命令 mysql pager more PAGER set to more mysql \P more PAGER set to more mysql pager less PAGER set to less mysql \P less PAGER set to less// 回到标准输出stdout mysql pager PAGER set to stdoutdelimiterdelimiter就是告诉MySQL解释器,命令的结束符是什么。默认情况下MySQL命令结束是以分号(;)在写过程或者函数等情况下这会产生不少问题因为存储过程中有许多语句所以每一个都需要一个分号。因此你需要选择一个不太可能出现在你的语句或程序中的字符串作为分隔符。mysql delimiter // mysql SELECT host,user FROM user//mysql delimiter ;3、服务器端命令For server side help, type help contentsmysql help contentsmysql help  KEYWORDmysqladmin用于执行管理性操作。语法是shell mysqladmin [OPTIONS] command [command-option] command ... 通过执行mysqladmin --help你可以得到你mysqladmin的版本所支持的一个选项列表。目前mysqladmin支持下列命令 create databasename         //创建一个新数据库 drop databasename           //删除一个数据库及其所有表 extended-status              //给出服务器的一个扩展状态变量 flush-hosts                  //刷新所有缓存的主机 flush-logs                   //刷新所有日志 flush-tables                 //刷新所有表 flush-privileges             //再次装载授权表(同reload) kill id,id,...              //杀死mysql线程 password                     //新口令将老口令改为新口令 ping                         //检查mysqld是否活着 processlist                  //显示服务其中活跃线程列表 reload                       //重载授权表 refresh                      //洗掉所有表并关闭和打开日志文件 shutdown                     //关掉服务器 status                       //给出服务器的简短状态消息--sleep N--count N variables                    //打印出服务器变量 version                      //得到服务器的版本信息所有命令可以被缩短为其唯一的前缀。非客户端工具myisamchk       # isam 表检查工具myisampack      # isam 表压缩工具 转载于:https://blog.51cto.com/skypegnu1/1421777
http://www.yutouwan.com/news/435990/

相关文章:

  • 做网站平台公司哪家好6月份去哪里旅游最好
  • 建网站难不难18芯城网站开发案例
  • 泸州做网站公司怎么样通过做网站赚钱
  • 长沙企业建站公司网页源代码修改了影响别人吗
  • 做3d模型的叫什么牛的网站房屋设计软件app自己设计画图
  • 怎么防止网站被注册机望野赏析
  • 怎样向搜索引擎提交网站wap网站引导页特效
  • 南阳网站排名价格广州品牌设计
  • 珠海建站网站wordpress编辑器商品模板
  • wordpress角色权限管理seo搜索优化技术
  • 有做浏览单的网站怎么上传文章网站
  • 网站后台密码存在哪wap网站如何制作
  • 小牛在线网站建设哪里网站建设专业
  • 网站建设销售员工作内容北京网站制作公司报价
  • wordpress站内搜索慢网络seo天津
  • 静态网站开发百科怎么用自己电脑做网站
  • 元素网站没有域名可以建网站吗
  • 公众平台如何做网站电脑系统优化软件
  • 强大的网站设计制作新乡市建设工程网站
  • 怎么做虚拟的网站长春三合一网站建设
  • 汽车网站建设的目的海阳有没有做企业网站的
  • 德语网站建设汽车之家2023官网
  • wordpress获取gallery怎么做好网站搜索引擎优化
  • 网站制作完成中卫网红大型蹦床设备
  • 能源门户网站建设网站建设怎样
  • 360网站推广官网苏州保洁公司哪家好一点
  • 郑州网站优化外包成品短视频app源码的下载方法
  • mt7620a做网站网站顶一下代码
  • 企业网站带后台模板网页设计流程步骤
  • 新建的网站怎么做seo优化东莞拓步网站建设