Common linux/mysql/php/tool commands

Source: Internet
Author: User
Tags scp file


Common linux/mysql/php/tool commands: 1. tar Backup directory tar zcvf ***** .tar.gz *****/tar backup skipping directory tar -- exclude = test1/* -- exclude = test2/*-czf $ WEBDIR/test.$DATETIME.tar.gz. /test2. scp file scp *** root @ B _ip: ***/3. scp directory scp-rp *** root @ B _ip: ***/4. create a database account grant all privileges on test. * TO 'test' @ 'IP' identified by '******'; the ip address is the Server ip address that allows access TO the database. svn directory # find. /-type d-name ". svn "-exec rm-fR {}\; 6. modify directory, file permissions, and user group find. /-type d-exec chmod-R 755 {}\; ---- directory 755 find. /-type f-exec chmod-R 644 {}\; ---- file 644 find. /-type f-exec chown root: nginx {}\; find. /-type d-exec chown root: nginx {}\; 7. yum, rpm Installation Software yum-y install package name (supported *): automatically select y, full automatic yum install package name (supported *): manually select y or nyum remove package name (not supported *) -www.2cto.com-rpm-ivh package name (supported *): Install rpm package rpm-e package name (not supported *): uninstall rpm package 8. mount storage nfsmount-t nfs-o rw, sync, noatime 192.168.0.200: /test/www/data/www/test9. error in unmounting storage umount/data/www/test10. failed to unmount storage ---- umount:/data/www/test: device is busyfuser-km/data/www/test and then execute umount/data/www/test11. clear the foreign key constraint SET FOREIGN_KEY_CHECKS = 0; 12. update the database flush privileges; 13. DBLIST = 'LS-p $ DATADIR | grep/| tr-d/'14. add chkconfig nginx onchkconfig mysqld onchkconfig php-fpm onchkconfig memcached on15. sed to replace -www.2cto.com-sed-I's # {IMG_URL} templates \/{TEMPLATE }\/#'{ TEMPLATE_URL} '# g'' grep {IMG_URL} templates \/{TEMPLATE}-rl. /'16. REPLACE mysql SQL ----- before replacement, remember to back up 'test' SET 'content' = replace ('content', 'replace _ before_str ', 'replace _ after_str '); UPDATE 'test' set 'content' = replace ('content', 'www .test.cn/upload/', 'upload.test.cn/') where content LIKE '% www.test.cn/upload/#' -www.2cto.com-17. create database 'dbname' default character set utf8 COLLATE utf8_general_ci; 18. clear the table truncate table 'tablename'; 19. backup database mysqldump-uroot-p dbname>/tmp/dbname. sql20. import the database without entering the database. Import mysql-uroot-p dbname </tmp/dbname. SQL to import the use dbname; SOURCE/tmp/dbname to the database. SQL; 21. alter table 'test' AUTO_INCREMENT = 28; Author: sunbiao0526

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.