lcentos7安装mysql_CentOS7安装mysql

CentOS7安装mysql

Adding the MySQL Yum Repository

First, add the MySQL Yum repository to your system's repository list. Follow these steps:

Go to the download page for MySQL Yum repository at http://dev.mysql.com/downloads/repo/yum/.

Select and download the release package for your platform.

Install the downloaded release package with the following command, replacing platform-and-version-specific-package-name with the name of the downloaded package:

shell> sudo rpm -Uvh platform-and-version-specific-package-name.rpm

For example, for version n of the package for EL6-based systems, the command is:

shell> sudo rpm -Uvh mysql57-community-release-el6-n.noarch.rpm

Selecting a Release Series

When using the MySQL Yum repository, the latest GA release of MySQL is selected for installation by default.

To install the latest release from the latest GA series, no configuration is needed. To install the latest release from a specific series other than the latest GA series, disable the subrepository for the latest GA series and enable the subrepository for the specific series before running the installation command. You can do that by editing manually the /etc/yum.repos.d/mysql-community.repo file. This is a typical entry for a release series' subrepository in the file:

[mysql57-community]

name=MySQL 5.7 Community Server

baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

Find the entry for the subrepository you want to configure, and edit the enabled option. Specify enabled=0 to disable a subrepository, or enabled=1 to enable a subrepository. For example, to install MySQl 5.6, make sure you have enabled=0 for the above subrepository entry for MySQL 5.7, and have enabled=1 for the entry for the 5.6 series:

# Enable to use MySQL 5.6

[mysql56-community]

name=MySQL 5.6 Community Server

baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/7/$basearch/

enabled=0

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

You should only enable subrepository for one release series at any time. When subrepositories for more than one release series are enabled, the latest series will be used by Yum.

Verify that the correct subrepositories have been enabled and disabled by running the following command and checking its output (for dnf-enabled systems, replace yum in the command with dnf):

shell> yum repolist enabled | grep mysql

Installing MySQL

Install MySQL by the following command:

shell> sudo yum install mysql-community-server

This installs the package for the MySQL server, as well as other required packages.

Note

For MySQL 5.7, a temporary, random root password is generated and stored in the error log, which is /var/log/mysqld.log for an installation using the MySQL Yum repository. You can use this command to see the password:

shell > sudo grep 'temporary password' /var/log/mysqld.log

You should change the root password as soon as possible; see Initializing the Data Directory Using mysqld for instructions.

Starting the MySQL Server

Start the MySQL server with the following command:

shell> sudo service mysqld start

You can check the status of the MySQL server with the following command:

shell> sudo service mysqld status

CentOS 7上MySQL的路径:

在根目录下find结果如下:

[root@localhost /]# find -name mysql

./etc/logrotate.d/mysql

./var/lib/pcp/config/pmlogconf/mysql

./var/lib/pcp/pmdas/mysql

./var/lib/mysql

./var/lib/mysql/mysql

./usr/bin/mysql

./usr/lib64/mysql

./usr/share/mysql

其中/usr/lib64/mysql目录下是mysql的lib库文件,其中还有插件库目录plugin。

[root@localhost mysql]# ll

total 19372

lrwxrwxrwx. 1 root root 20 Dec 10 15:32 libmysqlclient_r.so.18 -> libmysqlclient.so.18

lrwxrwxrwx. 1 root root 24 Dec 10 15:32 libmysqlclient_r.so.18.1.0 -> libmysqlclient.so.18.1.0

lrwxrwxrwx. 1 root root 24 Dec 10 15:32 libmysqlclient.so.18 -> libmysqlclient.so.18.1.0

-rwxr-xr-x. 1 root root 9595036 Nov 30 03:37 libmysqlclient.so.18.1.0

lrwxrwxrwx. 1 root root 24 Dec 10 15:32 libmysqlclient.so.20 -> libmysqlclient.so.20.1.0

-rwxr-xr-x. 1 root root 10232314 Nov 30 03:47 libmysqlclient.so.20.1.0

drwxr-xr-x. 4 root root 26 Dec 10 15:32 mecab

drwxr-xr-x. 3 root root 4096 Dec 10 15:32 plugin

plugin目录下的validate_password.so库文件是在修改MySQl密码是提示如下错误信息的罪魁祸首。

[root@localhost mysql]# ll plugin/

total 13280

-rwxr-xr-x. 1 root root 96431 Nov 30 03:46 adt_null.so

-rwxr-xr-x. 1 root root 51567 Nov 30 03:46 auth_socket.so

drwxr-xr-x. 2 root root 4096 Dec 10 15:32 debug

-rwxr-xr-x. 1 root root 389695 Nov 30 03:45 ha_example.so

-rwxr-xr-x. 1 root root 893413 Nov 30 03:46 innodb_engine.so

-rwxr-xr-x. 1 root root 806993 Nov 30 03:46 libmemcached.so

-rwxr-xr-x. 1 root root 8991266 Nov 30 03:46 libpluginmecab.so

-rwxr-xr-x. 1 root root 21261 Nov 30 03:46 locking_service.so

-rwxr-xr-x. 1 root root 57731 Nov 30 03:46 mypluglib.so

-rwxr-xr-x. 1 root root 49307 Nov 30 03:46 mysql_no_login.so

-rwxr-xr-x. 1 root root 57411 Nov 30 03:46 rewrite_example.so

-rwxr-xr-x. 1 root root 591058 Nov 30 03:46 rewriter.so

-rwxr-xr-x. 1 root root 758290 Nov 30 03:46 semisync_master.so

-rwxr-xr-x. 1 root root 157841 Nov 30 03:46 semisync_slave.so

-rwxr-xr-x. 1 root root 209234 Nov 30 03:46 validate_password.so

-rwxr-xr-x. 1 root root 415737 Nov 30 03:46 version_token.so

[root@localhost mysql]#

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('linus_dev!@#123');

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

/var/lib/mysql目录下是mysql的数据库文件,可以从以下对应关系看出:

[root@localhost mysql]# pwd

/var/lib/mysql

[root@localhost mysql]# ls

auto.cnf ca.pem client-key.pem ibdata1 ib_logfile1 mysql mysql.sock.lock private_key.pem server-cert.pem sys

ca-key.pem client-cert.pem ib_buffer_pool ib_logfile0 ibtmp1 mysql.sock performance_schema public_key.pem server-key.pem

[root@localhost mysql]# ls mysql

columns_priv.frm event.frm gtid_executed.frm help_topic.ibd plugin.ibd proxies_priv.MYI slave_worker_info.frm time_zone.ibd user.frm

columns_priv.MYD event.MYD gtid_executed.ibd innodb_index_stats.frm proc.frm server_cost.frm slave_worker_info.ibd time_zone_leap_second.frm user.MYD

columns_priv.MYI event.MYI help_category.frm innodb_index_stats.ibd proc.MYD server_cost.ibd slow_log.CSM time_zone_leap_second.ibd user.MYI

db.frm func.frm help_category.ibd innodb_table_stats.frm proc.MYI servers.frm slow_log.CSV time_zone_name.frm

db.MYD func.MYD help_keyword.frm innodb_table_stats.ibd procs_priv.frm servers.ibd slow_log.frm time_zone_name.ibd

db.MYI func.MYI help_keyword.ibd ndb_binlog_index.frm procs_priv.MYD slave_master_info.frm tables_priv.frm time_zone_transition.frm

db.opt general_log.CSM help_relation.frm ndb_binlog_index.MYD procs_priv.MYI slave_master_info.ibd tables_priv.MYD time_zone_transition.ibd

engine_cost.frm general_log.CSV help_relation.ibd ndb_binlog_index.MYI proxies_priv.frm slave_relay_log_info.frm tables_priv.MYI time_zone_transition_type.frm

engine_cost.ibd general_log.frm help_topic.frm plugin.frm proxies_priv.MYD slave_relay_log_info.ibd time_zone.frm time_zone_transition_type.ibd

[root@localhost mysql]# ls sys/

db.opt schema_redundant_indexes.frm wait_classes_global_by_latency.frm x@0024ps_schema_table_statistics_io.frm

host_summary_by_file_io.frm schema_table_lock_waits.frm waits_by_host_by_latency.frm x@0024schema_flattened_keys.frm

host_summary_by_file_io_type.frm schema_table_statistics.frm waits_by_user_by_latency.frm x@0024schema_index_statistics.frm

host_summary_by_stages.frm schema_table_statistics_with_buffer.frm waits_global_by_latency.frm x@0024schema_table_lock_waits.frm

host_summary_by_statement_latency.frm schema_tables_with_full_table_scans.frm x@0024host_summary_by_file_io.frm x@0024schema_table_statistics.frm

host_summary_by_statement_type.frm schema_unused_indexes.frm x@0024host_summary_by_file_io_type.frm x@0024schema_table_statistics_with_buffer.frm

host_summary.frm session.frm x@0024host_summary_by_stages.frm x@0024schema_tables_with_full_table_scans.frm

innodb_buffer_stats_by_schema.frm session_ssl_status.frm x@0024host_summary_by_statement_latency.frm x@0024session.frm

innodb_buffer_stats_by_table.frm statement_analysis.frm x@0024host_summary_by_statement_type.frm x@0024statement_analysis.frm

innodb_lock_waits.frm statements_with_errors_or_warnings.frm x@0024host_summary.frm x@0024statements_with_errors_or_warnings.frm

io_by_thread_by_latency.frm statements_with_full_table_scans.frm x@0024innodb_buffer_stats_by_schema.frm x@0024statements_with_full_table_scans.frm

io_global_by_file_by_bytes.frm statements_with_runtimes_in_95th_percentile.frm x@0024innodb_buffer_stats_by_table.frm x@0024statements_with_runtimes_in_95th_percentile.frm

io_global_by_file_by_latency.frm statements_with_sorting.frm x@0024innodb_lock_waits.frm x@0024statements_with_sorting.frm

io_global_by_wait_by_bytes.frm statements_with_temp_tables.frm x@0024io_by_thread_by_latency.frm x@0024statements_with_temp_tables.frm

io_global_by_wait_by_latency.frm sys_config.frm x@0024io_global_by_file_by_bytes.frm x@0024user_summary_by_file_io.frm

latest_file_io.frm sys_config.ibd x@0024io_global_by_file_by_latency.frm x@0024user_summary_by_file_io_type.frm

memory_by_host_by_current_bytes.frm sys_config_insert_set_user.TRN x@0024io_global_by_wait_by_bytes.frm x@0024user_summary_by_stages.frm

memory_by_thread_by_current_bytes.frm sys_config.TRG x@0024io_global_by_wait_by_latency.frm x@0024user_summary_by_statement_latency.frm

memory_by_user_by_current_bytes.frm sys_config_update_set_user.TRN x@0024latest_file_io.frm x@0024user_summary_by_statement_type.frm

memory_global_by_current_bytes.frm user_summary_by_file_io.frm x@0024memory_by_host_by_current_bytes.frm x@0024user_summary.frm

memory_global_total.frm user_summary_by_file_io_type.frm x@0024memory_by_thread_by_current_bytes.frm x@0024wait_classes_global_by_avg_latency.frm

metrics.frm user_summary_by_stages.frm x@0024memory_by_user_by_current_bytes.frm x@0024wait_classes_global_by_latency.frm

processlist.frm user_summary_by_statement_latency.frm x@0024memory_global_by_current_bytes.frm x@0024waits_by_host_by_latency.frm

ps_check_lost_instrumentation.frm user_summary_by_statement_type.frm x@0024memory_global_total.frm x@0024waits_by_user_by_latency.frm

schema_auto_increment_columns.frm user_summary.frm x@0024processlist.frm x@0024waits_global_by_latency.frm

schema_index_statistics.frm version.frm x@0024ps_digest_95th_percentile_by_avg_us.frm

schema_object_overview.frm wait_classes_global_by_avg_latency.frm x@0024ps_digest_avg_latency_distribution.frm

[root@localhost mysql]#

mysql> show databases;

+--------------------+

| Database |

+--------------------+

| information_schema |

| mysql |

| performance_schema |

| sys |

+--------------------+

4 rows in set (0.00 sec)

mysql> use mysql

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

Database changed

mysql> show tables;

+---------------------------+

| Tables_in_mysql |

+---------------------------+

| columns_priv |

| db |

| engine_cost |

| event |

| func |

| general_log |

| gtid_executed |

| help_category |

| help_keyword |

| help_relation |

| help_topic |

| innodb_index_stats |

| innodb_table_stats |

| ndb_binlog_index |

| plugin |

| proc |

| procs_priv |

| proxies_priv |

| server_cost |

| servers |

| slave_master_info |

| slave_relay_log_info |

| slave_worker_info |

| slow_log |

| tables_priv |

| time_zone |

| time_zone_leap_second |

| time_zone_name |

| time_zone_transition |

| time_zone_transition_type |

| user |

+---------------------------+

31 rows in set (0.00 sec)

mysql>

/usr/bin目录下有mysql的命令的可执行文件:

[root@localhost bin]# pwd

/usr/bin

[root@localhost bin]# ll mysql*

-rwxr-xr-x. 1 root root 11477801 Nov 30 03:47 mysql

-rwxr-xr-x. 1 root root 10227197 Nov 30 03:47 mysqladmin

-rwxr-xr-x. 1 root root 12213544 Nov 30 03:47 mysqlbinlog

-rwxr-xr-x. 1 root root 10497580 Nov 30 03:47 mysqlcheck

-rwxr-xr-x. 1 root root 819 Nov 30 03:35 mysql_config

-rwxr-xr-x. 1 root root 4907 Nov 30 03:45 mysql_config-64

-rwxr-xr-x. 1 root root 9110273 Nov 30 03:47 mysql_config_editor

-rwxr-xr-x. 1 root root 2611 Nov 30 03:45 mysqld_pre_systemd

-rwxr-xr-x. 1 root root 10582646 Nov 30 03:47 mysqldump

-rwxr-xr-x. 1 root root 7424 Nov 30 03:45 mysqldumpslow

-rwxr-xr-x. 1 root root 10214646 Nov 30 03:47 mysqlimport

-rwxr-xr-x. 1 root root 11553007 Nov 30 03:47 mysql_install_db

-rwxr-xr-x. 1 root root 5648858 Nov 30 03:47 mysql_plugin

-rwxr-xr-x. 1 root root 19144004 Nov 30 03:48 mysqlpump

-rwxr-xr-x. 1 root root 10168274 Nov 30 03:47 mysql_secure_installation

-rwxr-xr-x. 1 root root 10175703 Nov 30 03:47 mysqlshow

-rwxr-xr-x. 1 root root 10286246 Nov 30 03:47 mysqlslap

-rwxr-xr-x. 1 root root 5959171 Nov 30 03:45 mysql_ssl_rsa_setup

-rwxr-xr-x. 1 root root 5171930 Nov 30 03:45 mysql_tzinfo_to_sql

-rwxr-xr-x. 1 root root 13596456 Nov 30 03:47 mysql_upgrade

[root@localhost bin]#

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
4S店客户管理小程序-毕业设计,基于微信小程序+SSM+MySql开发,源码+数据库+论文答辩+毕业论文+视频演示 社会的发展和科学技术的进步,互联网技术越来越受欢迎。手机也逐渐受到广大人民群众的喜爱,也逐渐进入了每个用户的使用。手机具有便利性,速度快,效率高,成本低等优点。 因此,构建符合自己要求的操作系统是非常有意义的。 本文从管理员、用户的功能要求出发,4S店客户管理系统中的功能模块主要是实现管理员服务端;首页、个人中心、用户管理、门店管理、车展管理、汽车品牌管理、新闻头条管理、预约试驾管理、我的收藏管理、系统管理,用户客户端:首页、车展、新闻头条、我的。门店客户端:首页、车展、新闻头条、我的经过认真细致的研究,精心准备和规划,最后测试成功,系统可以正常使用。分析功能调整与4S店客户管理系统实现的实际需求相结合,讨论了微信开发者技术与后台结合java语言和MySQL数据库开发4S店客户管理系统的使用。 关键字:4S店客户管理系统小程序 微信开发者 Java技术 MySQL数据库 软件的功能: 1、开发实现4S店客户管理系统的整个系统程序; 2、管理员服务端;首页、个人中心、用户管理、门店管理、车展管理、汽车品牌管理、新闻头条管理、预约试驾管理、我的收藏管理、系统管理等。 3、用户客户端:首页、车展、新闻头条、我的 4、门店客户端:首页、车展、新闻头条、我的等相应操作; 5、基础数据管理:实现系统基本信息的添加、修改及删除等操作,并且根据需求进行交流信息的查看及回复相应操作。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值