mysql维护管理的几点小技巧(自我总结)

一、mysql数据库用户密码修改方法

(1)、在知道mysql数据库root用户密码条件下修改root用户密码wxsemico
方法一:
[[email protected] ~]# mysql -u root -p
Enter password: 输入root密码
mysql> show databases;
mysql> use mysql;
mysql> update user set password=password(‘wxsemico‘) where user=‘root‘;
mysql> flush privileges;
mysql> exit

方法二:
[[email protected] ~]# mysqladmin -u root -p[email protected] password wxsemico

/红色原密码,蓝色新密码
[[email protected] ~]# mysql -u root -pwxsemico
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 386
Server version: 5.1.42-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

mysql>

/使用新密码wxsemico登录成功

(3)、在忘记mysql数据库root用户密码条件下修改root用户密码为[email protected]
[[email protected] ~]# mysqladmin -u root -p shutdown
Enter password:
140523 18:50:33 mysqld_safe mysqld from pid file /usr/local/mysql/var/centos6.pid ended
[1]+  Done                    ./mysqld_safe --user=root --skip-grant-tables  (wd: /usr/local/mysql/bin)
(wd now: ~)
[[email protected] ~]# ps -ef | grep mysql
root      2751  1971  0 18:50 pts/0    00:00:00 grep mysql
/先关闭掉mysql数据库服务
/由于mysql为源码安装方式先切换至mysql安装目录下的bin目录
[[email protected] ~]# cd /usr/local/mysql/bin/
[[email protected] bin]# ll
total 16600
-rwxr-xr-x. 1 mysql mysql   10664 May 22  2013 innochecksum
-rwxr-xr-x. 1 mysql mysql    1424 May 22  2013 msql2mysql
-rwxr-xr-x. 1 mysql mysql 1794627 May 22  2013 myisamchk
-rwxr-xr-x. 1 mysql mysql 1667899 May 22  2013 myisam_ftdump
-rwxr-xr-x. 1 mysql mysql 1667299 May 22  2013 myisamlog
-rwxr-xr-x. 1 mysql mysql 1711644 May 22  2013 myisampack
-rwxr-xr-x. 1 mysql mysql 1398357 May 22  2013 my_print_defaults
-rwxr-xr-x. 1 mysql mysql  269500 May 22  2013 mysql
-rwxr-xr-x. 1 mysql mysql  110848 May 22  2013 mysqlaccess
-rwxr-xr-x. 1 mysql mysql   31997 May 22  2013 mysqladmin
-rwxr-xr-x. 1 mysql mysql  157601 May 22  2013 mysqlbinlog
-rwxr-xr-x. 1 mysql mysql   10675 May 22  2013 mysqlbug
-rwxr-xr-x. 1 mysql mysql   26276 May 22  2013 mysqlcheck
-rwxr-xr-x. 1 mysql mysql  415234 May 22  2013 mysql_client_test
-rwxr-xr-x. 1 mysql mysql    6137 May 22  2013 mysql_config
-rwxr-xr-x. 1 mysql mysql    4169 May 22  2013 mysql_convert_table_format
-rwxr-xr-x. 1 mysql mysql   23253 May 22  2013 mysqld_multi
-rwxr-xr-x. 1 mysql mysql   16690 May 22  2013 mysqld_safe
-rwxr-xr-x. 1 mysql mysql   91933 May 22  2013 mysqldump
-rwxr-xr-x. 1 mysql mysql    6602 May 22  2013 mysqldumpslow
-rwxr-xr-x. 1 mysql mysql    3245 May 22  2013 mysql_find_rows
-rwxr-xr-x. 1 mysql mysql     483 May 22  2013 mysql_fix_extensions
-rwxr-xr-x. 1 mysql mysql    5894 May 22  2013 mysql_fix_privilege_tables
-rwxr-xr-x. 1 mysql mysql   31485 May 22  2013 mysqlhotcopy
-rwxr-xr-x. 1 mysql mysql   26643 May 22  2013 mysqlimport
-rwxr-xr-x. 1 mysql mysql   14623 May 22  2013 mysql_install_db
-rwxr-xr-x. 1 mysql mysql    7694 May 22  2013 mysql_secure_installation
-rwxr-xr-x. 1 mysql mysql   16689 May 22  2013 mysql_setpermission
-rwxr-xr-x. 1 mysql mysql   24611 May 22  2013 mysqlshow
-rwxr-xr-x. 1 mysql mysql   46541 May 22  2013 mysqlslap
-rwxr-xr-x. 1 mysql mysql  192366 May 22  2013 mysqltest
-rwxr-xr-x. 1 mysql mysql 1368006 May 22  2013 mysql_tzinfo_to_sql
-rwxr-xr-x. 1 mysql mysql   65042 May 22  2013 mysql_upgrade
-rwxr-xr-x. 1 mysql mysql  159255 May 22  2013 mysql_waitpid
-rwxr-xr-x. 1 mysql mysql    3818 May 22  2013 mysql_zap
-rwxr-xr-x. 1 mysql mysql 1388574 May 22  2013 perror
-rwxr-xr-x. 1 mysql mysql 1380024 May 22  2013 replace
-rwxr-xr-x. 1 mysql mysql 1379698 May 22  2013 resolveip
-rwxr-xr-x. 1 mysql mysql 1381612 May 22  2013 resolve_stack_dump
[[email protected] bin]# ./mysqld_safe --user=root --skip-grant-tables &   /忽略授权表
[1] 2778
[[email protected] bin]# 140523 18:55:56 mysqld_safe Logging to ‘/usr/local/mysql/var/centos6.err‘.
140523 18:55:57 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var

[[email protected] bin]# cd   /切换至root家目录
[[email protected] ~]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.1.42-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

mysql>
/无需密码即可登录mysql数据库,通过前面的方法重新设置root用户新密码即可!

[[email protected] bin]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.1.42-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

mysql> select version();
+------------+
| version()  |
+------------+
| 5.1.42-log |
+------------+
1 row in set (0.00 sec)
/查询mysql数据库版本

mysql> select user();
+----------------+
| user()         |
+----------------+
| [email protected] |
+----------------+
1 row in set (0.00 sec)

/查询当前登录用户

mysql> select user from mysql.user;
+-------+
| user  |
+-------+
| cacti |
| root  |
| root  |
|       |
| root  |
|       |
| cacti |
| root  |
| user1 |
+-------+
9 rows in set (0.00 sec)

mysql> show grants;
+----------------------------------------------------------------------------------------------------------------------------------------+
| Grants for [email protected]                                                                                                              |
+----------------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘localhost‘ IDENTIFIED BY PASSWORD ‘*D4CD521B67294775430C15B348B47051EBA4B810‘ WITH GRANT OPTION |
| GRANT ALL PRIVILEGES ON `cacti`.* TO ‘root‘@‘localhost‘                                                                                |
+----------------------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

/查看授权情况

mysql> grant select,insert,update,delete on *.* to [email protected] identified by "zhang3";
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
/增加一个用户zhang3密码也为zhang3,让它可以从本机登录并对所有数据库有查询、插入、修改、删除权限
mysql> exit
[[email protected] ~]# mysql -u zhang3 -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 448
Server version: 5.1.42-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

mysql> select user();
+------------------+
| user()           |
+------------------+
| [email protected] |
+------------------+
1 row in set (0.00 sec)
/新建用户zhang3登录数据库成功

二、如何封装源码安装的mysql为系统服务


[[email protected] ~]# cd /usr/local/mysql/share/mysql/
[[email protected] mysql]# ll
total 1268
-rw-r--r--. 1 mysql mysql   1153 May 22  2013 binary-configure
drwxr-xr-x. 2 mysql mysql   4096 May 22  2013 charsets
-rw-r--r--. 1 mysql mysql   3805 May 22  2013 config.huge.ini
-rw-r--r--. 1 mysql mysql   1661 May 22  2013 config.medium.ini
-rw-r--r--. 1 mysql mysql    905 May 22  2013 config.small.ini
drwxr-xr-x. 2 mysql mysql   4096 May 22  2013 czech
drwxr-xr-x. 2 mysql mysql   4096 May 22  2013 danish
drwxr-xr-x. 2 mysql mysql   4096 May 22  2013 dutch
drwxr-xr-x. 2 mysql mysql   4096 May 22  2013 english
-rw-r--r--. 1 mysql mysql 416006 May 22  2013 errmsg.txt
drwxr-xr-x. 2 mysql mysql   4096 May 22  2013 estonian
-rw-r--r--. 1 mysql mysql 591883 May 22  2013 fill_help_tables.sql
drwxr-xr-x. 2 mysql mysql   4096 May 22  2013 french
drwxr-xr-x. 2 mysql mysql   4096 May 22  2013 german
drwxr-xr-x. 2 mysql mysql   4096 May 22  2013 greek
drwxr-xr-x. 2 mysql mysql   4096 May 22  2013 hungarian
drwxr-xr-x. 2 mysql mysql   4096 May 22  2013 italian
drwxr-xr-x. 2 mysql mysql   4096 May 22  2013 japanese
drwxr-xr-x. 2 mysql mysql   4096 May 22  2013 korean
-rw-r--r--. 1 mysql mysql   5006 May 22  2013 mi_test_all
-rw-r--r--. 1 mysql mysql   1517 May 22  2013 mi_test_all.res
-rw-r--r--. 1 mysql mysql   4778 May 22  2013 my-huge.cnf
-rw-r--r--. 1 mysql mysql  20167 May 22  2013 my-innodb-heavy-4G.cnf
-rw-r--r--. 1 mysql mysql   4752 May 22  2013 my-large.cnf
-rw-r--r--. 1 mysql mysql   4763 May 22  2013 my-medium.cnf
-rw-r--r--. 1 mysql mysql   2401 May 22  2013 my-small.cnf
-rwxr-xr-x. 1 mysql mysql   1061 May 22  2013 mysqld_multi.server
-rw-r--r--. 1 mysql mysql  42249 May 22  2013 mysql_fix_privilege_tables.sql
-rw-r--r--. 1 mysql mysql    837 May 22  2013 mysql-log-rotate
-rwxr-xr-x. 1 mysql mysql  12302 May 22  2013 mysql.server
-rw-r--r--. 1 mysql mysql   1878 May 22  2013 mysql_system_tables_data.sql
-rw-r--r--. 1 mysql mysql  16527 May 22  2013 mysql_system_tables.sql
-rw-r--r--. 1 mysql mysql   9669 May 22  2013 mysql_test_data_timezone.sql
-rw-r--r--. 1 mysql mysql    589 May 22  2013 ndb-config-2-node.ini
drwxr-xr-x. 2 mysql mysql   4096 May 22  2013 norwegian
drwxr-xr-x. 2 mysql mysql   4096 May 22  2013 norwegian-ny
drwxr-xr-x. 2 mysql mysql   4096 May 22  2013 polish
drwxr-xr-x. 2 mysql mysql   4096 May 22  2013 portuguese
drwxr-xr-x. 2 mysql mysql   4096 May 22  2013 romanian
drwxr-xr-x. 2 mysql mysql   4096 May 22  2013 russian
drwxr-xr-x. 2 mysql mysql   4096 May 22  2013 serbian
drwxr-xr-x. 2 mysql mysql   4096 May 22  2013 slovak
drwxr-xr-x. 2 mysql mysql   4096 May 22  2013 spanish
drwxr-xr-x. 2 mysql mysql   4096 May 22  2013 swedish
drwxr-xr-x. 2 mysql mysql   4096 May 22  2013 ukrainian
[[email protected] mysql]# cp mysql.server /etc/rc.d/init.d/mysql
[[email protected] init.d]# chkconfig --list | grep mysql
[[email protected] init.d]# chkconfig --add mysql
[[email protected] init.d]# chkconfig --list | grep mysql
mysql           0:off   1:off   2:on    3:on    4:on    5:on    6:off
[[email protected] init.d]# service mysql start
Starting MySQL....[  OK  ]
[[email protected] init.d]# ps -ef | grep mysql
root      2184     1  0 23:34 pts/0    00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/var --pid-file=/usr/local/mysql/var/centos6.pid
mysql     2287  2184  0 23:34 pts/0    00:00:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var --user=mysql --log-

error=/usr/local/mysql/var/centos6.err --pid-file=/usr/local/mysql/var/centos6.pid --socket=/tmp/mysql.sock --port=3306
root      2329  1849  0 23:35 pts/0    00:00:00 grep mysql
[[email protected] init.d]# service mysql stop
Shutting down MySQL.[  OK  ]
[[email protected] init.d]# ps -ef | grep mysql
root      2356  1849  0 23:35 pts/0    00:00:00 grep mysql

三、数据库的备份和恢复


[[email protected] ~]# mysql -uroot -pwxsemico
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1218
Server version: 5.1.42-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| cacti              |
| mysql              |
| test               |
| vpn                |
+--------------------+
5 rows in set (0.00 sec)

mysql> use vpn;
Database changed
mysql> show tables;
+---------------+
| Tables_in_vpn |
+---------------+
| vpnuser       |
+---------------+
1 row in set (0.00 sec)

mysql> desc vpnuser;
+----------+-----------+------+-----+---------+-------+
| Field    | Type      | Null | Key | Default | Extra |
+----------+-----------+------+-----+---------+-------+
| name     | char(20)  | NO   | PRI | NULL    |       |
| password | char(128) | YES  |     | NULL    |       |
| active   | int(10)   | NO   |     | 1       |       |
+----------+-----------+------+-----+---------+-------+
3 rows in set (0.00 sec)

mysql> select * from vpnuser;
+--------+-------------------------------------------+--------+
| name   | password                                  | active |
+--------+-------------------------------------------+--------+
| user1  | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |      1 |
| user2  | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |      1 |
| user3  | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |      1 |
| zhang3 | zhang123                                  |      1 |
+--------+-------------------------------------------+--------+
4 rows in set (0.00 sec)

(1)、数据库vpn备份
[email protected] ~]# mkdir /backup
[[email protected] ~]# mysqldump -uroot -pwxsemico vpn > /backup/vpn_bk.sql
[[email protected] ~]# mysqldump -uroot -pwxsemico vpn | gzip > /backup/vpn_bk.sql 
[[email protected] ~]# cd /backup
[[email protected] backup]# ll
total 8
-rw-r--r-- 1 root root 776 May 24 03:05 vpn_bk.sql
-rw-r--r-- 1 root root 776 May 24 03:08 vpn_bk.sql.gz
/如若需要备份的数据库容量较大,可采用gzip压缩方式来减少容量

(2)、删除数据库vpn中vpnuser表后恢复数据
mysql> drop table vpnuser;
Query OK, 0 rows affected (0.00 sec)

mysql> select * from vpn.vpnuser;
ERROR 1146 (42S02): Table ‘vpn.vpnuser‘ doesn‘t exist
mysql> exit
Bye
[[email protected] ~]# mysql -u root -pwxsemico vpn < /backup/vpn_bk.sql
[[email protected] ~]# mysql -u root -pwxsemico
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1497
Server version: 5.1.42-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| cacti              |
| mysql              |
| test               |
| vpn                |
+--------------------+
5 rows in set (0.00 sec)

mysql> select * from vpn.vpnuser;
+--------+-------------------------------------------+--------+
| name   | password                                  | active |
+--------+-------------------------------------------+--------+
| user1  | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |      1 |
| user2  | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |      1 |
| user3  | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |      1 |
| zhang3 | zhang123                                  |      1 |
+--------+-------------------------------------------+--------+
4 rows in set (0.00 sec)
/数据库vpn中vpnuser表及其数据恢复成功

(3)、直接删除vpn数据库后其数据恢复
[[email protected] ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1558
Server version: 5.1.42-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| cacti              |
| mysql              |
| test               |
| vpn                |
+--------------------+
5 rows in set (0.00 sec)

mysql> drop database vpn;
Query OK, 1 row affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| cacti              |
| mysql              |
| test               |
+--------------------+
4 rows in set (0.00 sec)

mysql> exit
Bye
[[email protected] ~]# mysql -uroot -pwxsemico vpn < /backup/vpn_bk.sql
ERROR 1049 (42000): Unknown database ‘vpn‘
[[email protected] ~]# mysql -uroot -pwxsemico
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1572
Server version: 5.1.42-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

mysql> create database vpn;
Query OK, 1 row affected (0.00 sec)
/删除vpn数据库后恢复数据库之前需先创建vpn数据库
mysql> exit
Bye
[[email protected] ~]# mysql -uroot -pwxsemico vpn < /backup/vpn_bk.sql
[[email protected] ~]# mysql -u root -pwxsemico
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1580
Server version: 5.1.42-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| cacti              |
| mysql              |
| test               |
| vpn                |
+--------------------+
5 rows in set (0.00 sec)

mysql> select * from vpn.vpnuser;
+--------+-------------------------------------------+--------+
| name   | password                                  | active |
+--------+-------------------------------------------+--------+
| user1  | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |      1 |
| user2  | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |      1 |
| user3  | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |      1 |
| zhang3 | zhang123                                  |      1 |
+--------+-------------------------------------------+--------+
4 rows in set (0.00 sec)
/vpn数据库及其vpnuser表中的数据恢复成功

四、其他相关操作


show status
/显示数据库的运行状态
show databases;
/显示数据库列表
use mysql;
/打开mysql数据库
show tables;
/显示mysql数据库中的数据表
describle 表名;
/显示数据表的结构
create database 库名;
/创建特定名称数据库
drop database 库名;
/删除特定名称数据库
create table 表名(字段设定列表)
/创建数据库中的特定表
drop table 表名;
/删除特定名称的表
delete from 表名;
/清空表记录
select * from 表名;
/显示表中的记录
insert into 表名 values(, ,)
/插入值到表中
alter table 表名 add column <字段名><字段选项>
/修改字段

mysql维护管理的几点小技巧(自我总结),布布扣,bubuko.com

时间: 2024-10-18 19:03:36

mysql维护管理的几点小技巧(自我总结)的相关文章

Java内存管理的9个小技巧

Java内存管理的9个小技巧很多人都说“Java完了,只等着衰亡吧!”,为什么呢?最简单的的例子就是Java做的系统时非常占内存!一听到这样的话,一定会有不少人站出来为Java辩护,并举出一堆的性能测试报告来证明这一点.其实从理论上来讲Java做的系统并不比其他语言开发出来的系统更占用内存,那么为什么却有这么多理由来证明它确实占内存呢?两个字,陋习. 1.别用new Boolean(). 在很多场景中Boolean类型是必须的,比如JDBC中boolean类型的set与get都是通过Boolea

mysql数据库中文乱码的一点小技巧

查询数据库中的所使用的字符集 SHOW VARIABLES LIKE 'CHARACTER%' 设置数据库的字符编码集 URL=jdbc:mysql://127.0.0.1:3306/user?characterEncoding=utf8 今天添加数据到数据库,刚好就碰到了中文乱码,将eclipse里面的默认字符集和mysql数据库里面的字符集都改成了utf8,部署运行后还是不行. 后来在网上搜了一下,刚好看到了上面的这个方法, 在数据库连接池的配置文件中改了一下URL的地址,然后就好了.

服务器维护十二点小技巧

服务器维护清单 服务器是令人惊奇的信息设备.服务器运行时发出哼哼的声音,一般没有问题,但他们确实像任何机器设备一样需要我们经常性去维护. 如果您使用鼎峰网络的服务器维护解决方案,您不必担心服务器会出现什么故障.鼎峰网络拥有一流的监测,审查维护团队和保持24小时在线工程师随时待命,但如果你正在管理自己的服务器上,这里有十二点服务器维护技巧,应该是您的服务器维护清单的一部分. 十二点服务器维护技巧 1. 请确认您的备份正在工作. 在进行任何更改到生产系统之前,请确保您的备份工作.你甚至可以运行一些测

带你了解MySQL数据库小技巧

兴趣是最好的老师,不论学习什么知识,兴趣都可以极大地提高学习效率.当然学习MySQL 5.6也不例外.本文列举37 个 MySQL 数据库小技巧,快来学习吧! 37 个 MySQL 数据库小技巧! 1.如何快速掌握MySQL? 培养兴趣 兴趣是最好的老师,不论学习什么知识,兴趣都可以极大地提高学习效率.当然学习MySQL 5.6也不例外. 夯实基础 计算机领域的技术非常强调基础,刚开始学习可能还认识不到这一点,随着技术应用的深 入,只有有着扎实的基础功底,才能在技术的道路上走得更快.更远.对于M

MySQL数据库web维护管理软件

TreeSoft数据库管理系统使用JAVA开发,采用稳定通用的springMVC +JDBC架构,实现基于WEB方式对 MySQL,Oracle,PostgreSQL 等数据库进行维护管理操作. 功能包括:数据库的展示,库表的展示,表字段结构的展示, SQL语句的在线编辑批量执行,表结构的在线设计维护,数据的在线编辑维护,查询语句保存,JSON数据格式化,SQL语法帮助,在线数据源选择配置等.系统内置14套UI皮肤,45套代码编辑区UI方案,使用中可以依个人喜好选择配色方案. 软件不但稳定,实用

MySQL,Oracle,PostgreSQL 数据库web维护管理软件

TreeSoft数据库管理系统使用JAVA开发,采用稳定通用的springMVC +JDBC架构,实现基于WEB方式对 MySQL,Oracle,PostgreSQL 等数据库进行维护管理操作. 功能包括:数据库的展示,库表的展示,表字段结构的展示, SQL语句的在线编辑批量执行,表结构的在线设计维护,数据的在线编辑维护,查询语句保存,JSON数据格式化,SQL语法帮助,在线数据源选择配置等.系统内置14套UI皮肤,45套代码编辑区UI方案,使用中可以依个人喜好选择配色方案. 本系统不但稳定,实

mysql写Shell小技巧

今天终于在表哥的帮助下解决了文件导入/出这个问题了.(很菜逼的一个问题),然后将最近看到的文章都自己测试了下,顺便奉上记录.1.Mysql数据库支持union的时候写文件小技巧: 采用常规的union写入,可以看到前面的字段占位数肯定也会被写入,替换成null也是一样的结果,这个对于写shell没啥大碍,但是如果用来写bat,mof,vbs等文件就会出问题了,那么怎么去掉这个只写入我们需要的内容呢?采用hex编码就好了. 将我们要写入的内容使用hex编码在分段写在每个字段位上,这样就可以只写入我

10个提升MySQL百家乐性能baijiale的小技巧

从工作量分析到索引的三条规则,这些专家见解肯定会让您的MySQL服务器尖叫. 在所有的关系数据库中,MySQL已经被证明了完全是一头野兽,只要通知停止运行就绝对不会让你多等一秒钟,使你的应用置于困境之中,你的工作也承受极大的风险. 不过事实是,普通的错误都在MySQL性能错误的射程之内.所以为了使你的MySQL服务器能够高速运转,提供稳定且持续的服务,消除这些错误是非常有必要的,但是这可能常常会被你的繁忙工作或配置陷阱微妙地遮蔽了. 幸运的是,许多MySQL性能问题其实都有相似的解决办法,发现并

MySQL安全小技巧

MySQL安全小技巧,后面会慢慢补充. mysql命令行有个参数 -U, --safe-updates  Only allow UPDATE and DELETE that uses keys. 表示安全的更新,就是说delete或者update数据的时候,必须加上条件,不然就报错.如下图: 我们可以做个别名 echo 'alias mysql="mysql -U"' >> /etc/profile source /etc/profile 这样的话,其他用户登录mysql,