先設使用底下指令設定auto-commit為on
set-session-property auto-commit on
使用方式如下:
usage: dump-out <filename> <tablename>
所以可以這樣下
dump-out xxx.sql table_name
參考網址:
http://henplus.sourceforge.net/
set-session-property auto-commit on
usage: dump-out <filename> <tablename>
dump-out xxx.sql table_name
<?php $inipath = php_ini_loaded_file(); echo $inipath;
table_open_cache_instances=2 #http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_table_open_cache_instances table_open_cache=16384 #http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_table_open_cache table_definition_cache=16384 #http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_table_definition_cache tmp_table_size=64M #http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_tmp_table_size
join_buffer_size=512k #http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_join_buffer_size
<p style="word-break: break-all;"><a href="http://www.google.com">Google</a><p>
#安裝requests ref: http://docs.python-requests.org/en/v1.0.0/community/out-there/ $ yum install python-requests oaded plugins: fastestmirror, replace Setting up Install Process Determining fastest mirrors epel/metalink | 3.9 kB 00:00 * base: centos.cs.nctu.edu.tw * epel: ftp.cuhk.edu.hk * extras: centos.cs.nctu.edu.tw * updates: centos.cs.nctu.edu.tw * webtatic: sp.repo.webtatic.com base | 3.7 kB 00:00 dag | 1.9 kB 00:00 epel | 4.3 kB 00:00 epel/primary_db | 5.9 MB 00:01 extras | 3.4 kB 00:00 extras/primary_db | 37 kB 00:00 kbs-CentOS-Misc | 1.9 kB 00:00 updates | 3.4 kB 00:00 updates/primary_db | 4.6 MB 00:00 webtatic | 3.6 kB 00:00 webtatic/primary_db | 191 kB 00:00 Resolving Dependencies --> Running transaction check ---> Package python-requests.noarch 0:2.6.0-3.el6 will be installed --> Processing Dependency: python-urllib3 >= 1.10.2-1 for package: python-requests-2.6.0-3.el6.noarch ............ ............ Dependencies Resolved ==================================================================================================== Package Arch Version Repository Size ==================================================================================================== Installing: python-requests noarch 2.6.0-3.el6 base 95 k Installing for dependencies: python-backports x86_64 1.0-5.el6 base 5.5 k python-backports-ssl_match_hostname noarch 3.4.0.2-4.el6.centos extras 13 k python-chardet noarch 2.2.1-1.el6 base 230 k python-six noarch 1.9.0-2.el6 base 28 k python-urllib3 noarch 1.10.2-1.el6 base 101 k Transaction Summary ==================================================================================================== Install 6 Package(s) Total download size: 472 k Installed size: 1.9 M Is this ok [y/N]: y ............ ............ Complete!這樣就完成了。
$ python -V Python 2.6.6
$ wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-1.4.2.tar.gz $ tar -xvf setuptools-1.4.2.tar.gz $ cd setuptools-1.4.2 $ python setup.py install #安裝動作必須是root權限
$ wget https://pypi.python.org/packages/source/o/openpyxl/openpyxl-2.4.0-a1.tar.gz $ tar -xvf openpyxl-2.4.0-a1.tar.gz $ cd openpyxl-2.4.0-a1 $ python setup.py install #安裝動作必須是root權限
$ mysql_upgrade --force -u root -p Enter password: MySQL upgrade detected Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK mysql.columns_priv OK mysql.db OK mysql.event OK mysql.func OK mysql.gtid_slave_pos OK mysql.help_category OK mysql.help_keyword OK #.......忽略 Phase 6/6: Running 'FLUSH PRIVILEGES' OK
$ mysqldump -uroot -p --all-databases --flush-logs --master-data=2 > /Users/alvin/all_databases.sql Enter password: mysqldump: Error: Binlogging on server not active
$ vim ~/.my.cnf #加入 log-bin=mysql-bin #重啟mysql server $ /usr/local/mysql/support-files/mysql.server restart #再dump一次 $ mysqldump -uroot -p --all-databases --flush-logs --master-data=2 > /Users/alvin/all_databases.sql這樣就備份好了
$ vim ~/.my.cnf log-error=/tmp/mysql.log
$ mysql.server start Starting MySQL . SUCCESS!
$>yum install mod_ssl openssl #安裝ssl套件 $>openssl genrsa -out ca.key 2048 #產生私鑰 $>openssl req -new -key ca.key -out ca.csr #產生 CSR $>openssl x509 -req -days 365 -in ca.csr -signkey ca.key -out ca.crt #產生自我簽署的金鑰 #複製檔案至正確位置 $>cp ca.crt /etc/pki/tls/certs $>cp ca.key /etc/pki/tls/private/ca.key $>cp ca.csr /etc/pki/tls/private/ca.csr #假如你遷移了這些檔案而不是複製它們,你可以用以下的指命來矯正這些檔案的 SELinux 脈絡 $>restorecon -RvF /etc/pki $>vi /etc/httpd/conf.d/ssl.conf #找到SSLCertificateFile 改成 /etc/pki/tls/certs/ca.crt SSLCertificateFile /etc/pki/tls/certs/ca.crt #找到SSLCertificateKeyFile 改成 /etc/pki/tls/private/ca.key SSLCertificateKeyFile /etc/pki/tls/private/ca.key #重啟http server $>service httpd restart
$num = 1; echo str_pad($num, 4, "0", STR_PAD_LEFT); //==> 0001
$str = 'Alvin'; echo str_pad($str, 10); //==> 'Alvin ' $str = 'Alvin'; echo str_pad($str, 10, "_", STR_PAD_BOTH) //==> '__Alvin___'
//下載wget-1.5.3.tar.gz 更名為wget.zip $ wget -O wget.zip http://ftp.gnu.org/gnu/wget/wget-1.5.3.tar.gz //續傳 $ wget -c http://mirrors.hns.net.in/centos/6.3/isos/x86_64/CentOS-6.3-x86_64-LiveDVD.iso //ftp with username $ wget --ftp-user=narad --ftp-password=password ftp://ftp.iinet.net.au/debian/debian-cd/6.0.5/i386/iso-dvd/debian-6.0.5-i386-DVD-1.iso //http with username $ wget --http-user=narad --http-password=password http://mirrors.hns.net.in/centos/6.3/isos/x86_64/CentOS-6.3-x86_64-LiveDVD.iso //背景執行 $ wget -b /wget/log.txt ftp://ftp.iinet.net.au/debian/debian-cd/6.0.5/i386/iso-dvd/debian-6.0.5-i386-DVD-1.iso