Linux Work notes __linux

Source: Internet
Author: User
Tags auth uuid mysql command line

1 starts mysql:service mysqld start Or/etc/init.d/mysql start

2 "Start Network: Service network start or/etc/init.d/network start

3 "System setup: Setup

Network configuration: Vi/etc/sysconfig/network-scripts/ifcfg-eth0

4 "RPM Package Installation: Rpm-ivh *.rpm

RPM Package detection version: RPM-Q software name

RPM Package Uninstall: RPM-E software name or related installation

RPM-UVH *.rpm Software upgrades

5 "Linux under the MySQL modify character word problem (www.net527.cn/a/caozuoxitong/Linux/9817.html)

1 Modify the character set installed MySQL default character set for Latin1, in order to change its character set to the user needs (such as UTF8), you must change its relevant configuration file;

The default installation directory for MySQL under Linux is distributed under different files;

Unlike windows in the same directory, just modify the My.ini file, after the restart will take effect;

So first look at the Linux MySQL database files, configuration files and command files in a different directory: 1, the database directory, the database files created by the directory/var/lib/mysql/.

2, the configuration file (Mysql.server command and configuration file location)/usr/share/mysql.

3, related commands (such as MySQL mysqladmin, etc.). /usr/bin 4, startup script (such as MySQL startup command)/ETC/RC.D/INIT.D/5, modify character set: 1. Find my.cnf files under/etc directory; #ls-l | grep my.cnf (Find out if there are my.cnf files under/etc) 2. If there is no need to copy one to/etc from/usr/share/mysql, the/usr/share/mysql directory has five suffixes of. CNF, respectively. MY-HUGE.CNF my-innodb-heavy-4g.cnf my-large.cnf my-medium.cnf my-small.cnf; copy one to the/etc directory and change it to my.cnf file. I chose my-medium.cnf: #cp/usr/share/mysql/my-medium.cnf/etc/my.cnf 3. Modify my.cnf file, add default-character-set= to three places in the document UTF8 ([client] [mysqld] [MySQL])

2) Restart Mysql:service mysqld restart.

3 in the MySQL control interface with the command set names UTF8.

4 to view the MySQL characters related information: show variables like ' collation_% ' and ' variables as ' character_set_% '.

5 Other settings for some MySQL character sets:

Modify the database's character set Mysql>use mydb Mysql>alter db mydb character set utf-8; Create a database The character set of the specified database mysql>create the DB mydb character set utf-8; Modified by configuration file: Modify/var/lib/mysql/mydb/db.opt default-character-set=latin1 default-collation=latin1_swedish_ci to

Default-character-set=utf8 Default-collation=utf8_general_ci

Modify via MySQL command line:

Mysql> set Character_set_client=utf8; Mysql> set Character_set_connection=utf8; Mysql> set Character_set_database=utf8; Mysql> set Character_set_results=utf8; Mysql> set Character_set_server=utf8; Mysql> set Character_set_system=utf8; Mysql> set Collation_connection=utf8; Mysql> set Collation_database=utf8; Mysql> set Collation_server=utf8;

6 "Fedora Landing to root method." Fedora disables the root user for the system's security default configuration.

1) using the SU command

2 Edit/ECT/PAM.D/GDM file and comment out (precede with # or delete this line)

#auth Required pam_succeed_if.so user!= root quiet

3 edit/etc/pam.d/gdm-password& file and comment out (precede with # or delete this line)

#auth Required pam_succeed_if.so user!= root quiet

7 "CPU View PS aux | More (see http://www.360doc.com/content/10/0325/17/539694_20233889.shtml for more details)

Or top is a dynamic display process that refreshes the current state with user keystrokes.

8 Modify the folder context value.

#mkdir/home/newdir

#ls-dz/home/newdir/

Drwxr-xr-x root root root:obiect_r:user_home_t/home/newdir/

#ls-dz/var/www/

Drwxr-xr-x root root system_u:object_r:httpd_sys_content_t/var/www/

#chcon-R-T httpd_sys_content_t/home/newdir/

#ls-dz/home/newdir/

Drwxr-xr-x root root root:obiect_r:uhttpd_sys_content_t/home/newdir/

9 "Yum Software management tools

Yum Install software name

Yum Update software name

10 Turn on forwarding:/etc/sysctl.conf # Controls IP packet Forwarding Net.ipv4.ip_forward = 1

Static routes: Route add-net 192.168.10.0 netmask 255.255.255.0 GW 192.168.0.254

Dynamic routing:/etc/quagga/*.conf files include RIP,OSPF, etc.

1) Configure/etc/quagga/zebra.conf hostname linux.router1 password redhat enable password Redhat log file Zebra.log

2) Open service,/etc/init.d/zebra restart

3) Configure Routing vim/etc/quagga/ripd.conf hostname linux.router1 password redhat router RIP network 11.0.0.0/8 network 192.0.0.0/24 Network eth0 Route 10.0.0.0/8

4 Telnet Connection Router interface, NETSTAT–TCLNP see RIP is which port telnet 127.0.0.1 2602 into the RIP configuration interface

5) Last Telnet 127.0.0.1 2601 View route entry

11 "Create Physical volume

[ROOT@HCTV ~]# PVCREATE/DEV/MD1


[ROOT@HCTV ~]# PVDISPLAY/DEV/MD1

"/dev/md1" is a new physical volume of "101.81 MB"

---NEW physical volume---

PV NAME/DEV/MD1

VG Name

PV Size 101.81 MB

Allocatable NO

PE Size (KByte) 0

Total PE 0

Free PE 0

Allocated PE 0

PV UUID BI2NR5-HHM7-E2HD-MIUE-IFWN-UTYT-U0TJFZ


12 "Create Volume group

[ROOT@HCTV ~]# vgcreate vg01/dev/md1


[ROOT@HCTV ~]# VGDISPLAY/DEV/VG01

---Volume Group---

VG Name vg01

System ID

Format lvm2

Metadata Areas 1

Metadata Sequence No 1

VG Access Read/write

VG Status resizable

MAX LV 0

Cur LV 0

Open LV 0

Max PV 0

Cur PV 1

ACT PV 1

VG Size 100.00 MB

PE Size 4.00 MB

Total PE 25

Alloc pe/size 0/0

Free Pe/size 25/100.00 MB

VG UUID W3qsp6-3wwh-gwfd-lbug-v2b9-mfbe-pnarij


13 Create logical volume (to be less than PE size, 100M here)

[ROOT@HCTV ~]# lvcreate-l 90m-n data vg01 data:logical volume name

Rounding up size to full physical extent 92.00 MB

Logical volume "Data" created


Format:

[ROOT@HCTV ~]# Mkfs.ext3/dev/vg01/data


Mount:

[ROOT@HCTV ~]# mount/dev/vg01/data/data/


[ROOT@HCTV ~]# Df-h

/dev/mapper/vg01-data

90M 5.6M 79M 7%/data


14 adds a disk, the format is 8e

/dev/sdb7 104391 8e Linux LVM


11) Create Physical volume

[ROOT@HCTV ~]# Pvcreate/dev/sdb7


Add the new physical volume to the physical volume vg01

[ROOT@HCTV ~]# Vgextend vg01/dev/sdb7

Volume Group "VG01" successfully extended

[root@www254 ~]# Vgdisplay vg01

---Volume Group---

VG Name vg01

System ID

Format lvm2

Metadata Areas 2

Metadata Sequence No 2

VG Access Read/write

VG Status resizable

MAX LV 0

Cur LV 0

Open LV 0

Max PV 0

Cur PV 2

ACT PV 2

VG Size 200.00 MB

PE Size 4.00 MB

Total PE 50

Alloc pe/size 0/0

Free Pe/size 50/200.00 MB

VG UUID eokfgj-lloy-hlgo-iqi6-wbk6-tnsi-rz3652


15 "Extended Logical Volume size 80M

[ROOT@HCTV ~]# lvextend-l +80m/dev/vg01/data


Resize size

[ROOT@HCTV ~]# resize2fs-p/dev/vg01/data-p Print


[ROOT@HCTV ~]# Df-h

/dev/mapper/vg01-data

167M 5.6M 153M 4%/data


16 Reduce Logical Volume size 50M 167M-à117m

Four Step walk:

i) Uninstall First:

[ROOT@HCTV ~]# Umount/data

II) and then check the file:

[ROOT@HCTV ~]# fsck-f/dev/vg01/data

III) redefining the file size to 100M

[ROOT@HCTV ~]# Resize2fs/dev/vg01/data 100M

IV) is the size of the logical volume reduced to 100M

[ROOT@HCTV ~]# lvreduce/dev/vg01/data-l 100M


17 Removal of physical volumes

[ROOT@HCTV ~]# Pvmove/dev/sdb7

[ROOT@HCTV ~]# vgreduce vg01/dev/sdb7


How to delete a physical volume.

1 Delete vg: actually delete lv:

[root@www254 ~]# LVREMOVE/DEV/VG01/LV01

[root@www254 ~]# Vgremove vg01

2 Delete except PV:

[root@www254 ~]# Pvremove/dev/sdb7

[root@www254 ~]# PVREMOVE/DEV/MD1

3) Stop raid

[root@www254 ~]# mdadm-s/dev/md1

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.