Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The basics of daily operation of mysql

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

I. Database Version:

Community Enterprise Cluster

Community Edition: Free to use (for personal use, not commercial use)

Enterprise edition: cheaper than cluster edition

Cluster version:

Official website: http://www.mysql.org

II. Installation of mysql (mysql toolkit mysql-server module and function package)

#yum -y install mysql mysql-server ##yum install

Default port: 3306

Main configuration file: /etc/my.cnf

#ps aux |grep mysqld ##View service-related module information

important parameter

--datadir=/var/lib/mysql (data directory)

--socket=/var/lib/mysql/mysql.socket

--basedir=/usr/installation directory

--user= user identity of the process running

--log-error=/var/log/mysqld.log Specifies the database error log directory

#cd /var/lib/mysql

#ls (mysql)

mysql (data table file) ib_lngfilel (index file) mysql.sock

#cd ./ mysql

--datadir data directory

Store database related information

.frm data table structure

.myd data table data

.myi data table index file

mysql.sock database socket file

mysql login

-u Login Name

-p cipher

-h Specifies the mysql server address

-P port

Set password mysqladmin for database administrator

#mysqladmin -uroot password '123'; ##Add initial password

#mysql -uroot -p ##Login to mysql

mysql>create user lisi@'localhost'identified by

'123'; ##Create lisi user local login mysql

mysql>create user zhangsan@'%'identified by '123';##create zhangsan user can log in remotely to mysql from any remote address

mysql>set password for'user'@'login address'=password ("new password");

Forgot database password Solution:

1. stop the database

2. Modify the main configuration file to add a line of code: skip-grant-tables

3. restart the service

4. reset your password

mysql>set password=password ('new password'); ##Change administrator database user password

At this time, an error will be reported because the grant authentication table has been skipped, and the user data table in the database needs to be updated mysql>update mysql.user set password=password ('new password') where user='root';

display database

>show databases;

Display content under a specific database

>use test;

>create table a2(

id int unsigned not null auto_increment,

name char(40) not null default "",

info char(208) null,

primary key(id));

id

name

info

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report