数据库

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介:

1、重新初始化建库

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
[root@etiantian data]# mkdir mysql
[root@etiantian data]chown -R mysql.mysql mysql
[root@etiantian data]/install/mysql/scripts/mysql_install_db--basedir=/install/mysql/ --datadir=/data/mysql/ --user=mysql
Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time  you have to copy
support-files/mysql.server to the right place for  your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do  so, start the server, then  issue the following commands:
/install/mysql//bin/mysqladmin  -u root password 'new-password'
/install/mysql//bin/mysqladmin  -u root -h etiantian.cn password'new-password'
Alternatively you can run:
/install/mysql//bin/mysql_secure_installation
which  will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for  production servers.
See the manual for  more  instructions.
You can start the MySQL daemon with:
cd  /install/mysql/  /install/mysql//bin/mysqld_safe  &
You can test  the MySQL daemon with mysql-test-run.pl
cd  /install/mysql//mysql-test  ; perl mysql-test-run.pl
Please report any problems with the /install/mysql//scripts/mysqlbugscript
 
 
 
 
 
[root@etiantian data]/etc/init.d/mysqld start
Starting MySQL.......................... SUCCESS!
[root@etiantian data]mysql
mysql:Collation'utf8-general_ci'  is not a compiled collation and is not specifiedin the '/install/mysql/share/charsets/Index.xml'  file
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id  is 1
Server version: 5.5.33-log Source distribution
Copyright (c) 2000, 2013, Oracle and/or  its affiliates. All rightsreserved.
Oracle is a registered trademark of Oracle Corporation and/or  its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;'  or '\h'  for  help. Type '\c'  to clear  the current inputstatement.
mysql> quit
-> Ctrl-C -- exit!
Aborted

 

 

 

 

[root@etiantian data]cat /root/.mysql_history |grep create

create\040database\040eshop_ett100\040DEFAULT\040CHARACTER\040SET\040utf8\040COLLATE\040utf8_general_ci;确定建库的命令。
[root@etiantian data]# mysql
mysql: Collation 'utf8-general_ci'  is not a compiled collation andis not specified in  the '/install/mysql/share/charsets/Index.xml'  file
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id  is 2
Server version: 5.5.33-log Source distribution
Copyright (c) 2000, 2013, Oracle and/or  its affiliates. All rightsreserved.
Oracle is a registered trademark of Oracle Corporation and/or  its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;'  or '\h'  for  help. Type '\c'  to clear  the current inputstatement.
mysql> create database eshop_ett100 CHARACTER SET utf8 COLLATE utf8_general_ci;
Query OK, 1 row affected (0.00 sec)
mysql> quit
Bye

 

 

 

 

 

[root@etiantian data]mysql eshop_ett100 </home/xxx/eshop_ett100.0624.sql
mysql: Collation 'utf8-general_ci'  is not acompiled collation and is not specified in  the'/install/mysql/share/charsets/Index.xml'  file
ERROR 1030 (HY000) at line 46: Got error -1from storage engine

 

 

 

 

 

[root@etiantian data]# pwd
/data
[root@etiantian data]# rm -fr mysql
[root@etiantian data]# mkdir mysql
[root@etiantian data]chown -R mysql.mysql <==这是着急的杰作,连目标都没加,偶也紧张啊。
chown: missing operand after `mysql.mysql'
Try `chown  --help' for  more  information.
[root@etiantian data]chown -R mysql.mysql mysql
 
[root@etiantian data]/install/mysql/scripts/mysql_install_db--basedir=/install/mysql/ --datadir=/data/mysql/ --user=mysql
 
Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time  you have to copy
support-files/mysql.server to the right place for  your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do  so, start the server, then  issue the following commands:
/install/mysql//bin/mysqladmin  -u root password 'new-password'
/install/mysql//bin/mysqladmin  -u root -h etiantian.cn password'new-password'
Alternatively you can run:
/install/mysql//bin/mysql_secure_installation
which  will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for  production servers.
See the manual for  more  instructions.
You can start the MySQL daemon with:
cd  /install/mysql/  /install/mysql//bin/mysqld_safe  &
You can test  the MySQL daemon with mysql-test-run.pl
cd  /install/mysql//mysql-test  ; perl mysql-test-run.pl
Please report any problems with the /install/mysql//scripts/mysqlbugscript
 
 
[root@etiantian data]/etc/init.d/mysqld start
Starting MySQL......................... SUCCESS!
[root@etiantian data]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id  is 1
Server version: 5.5.33-log Source distribution
Copyright (c) 2000, 2013, Oracle and/or  its affiliates. All rightsreserved.
Oracle is a registered trademark of Oracle Corporation and/or  its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;'  or '\h'  for  help. Type '\c'  to clear  the current inputstatement.
 
 
[root@etiantian data]mysql eshop_ett100 </home/xxx/eshop_ett100.0624.sql
ERROR 1030 (HY000) at line 46: Got error -1 from storage engine
[root@etiantian data]/etc/init.d/mysqld stop
Shutting down MySQL. SUCCESS!
[root@etiantian data]# vi /etc/my.cnf <==此处顺便调整相关其他参数
innodb_force_recovery= 0 调整这个参数为0
skip-external-locking
key_buffer_size = 256M
max_allowed_packet = 1M
table_open_cache = 614
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
query_cache_limit = 1M
query_cache_min_res_unit = 2k
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
........
"/etc/my.cnf"  159L, 4948C written 
 
 
[root@etiantian data]/etc/init.d/mysqld start
Starting MySQL.
. SUCCESS!
[root@etiantian data]#
[root@etiantian data]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id  is 1
Server version: 5.5.33-log Source distribution
Copyright (c) 2000, 2013, Oracle and/or  its affiliates. All rightsreserved.
Oracle is a registered trademark of Oracle Corporation and/or  its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;'  or '\h'  for  help. Type '\c'  to clear  the current inputstatement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| eshop_ett100 |
test  |
+--------------------+
5 rows in  set  (0.00 sec)

 










本文转自 chengxuyonghu 51CTO博客,原文链接:http://blog.51cto.com/6226001001/1541355,如需转载请自行联系原作者

相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
7月前
|
关系型数据库 Linux BI
数据库的一些知识
数据库的一些知识
28 0
|
18天前
|
关系型数据库 MySQL 数据库
数据库(四)
`DELETE` 语句用于从表中移除数据。基本语法是 `DELETE FROM 表名 WHERE 条件表达式`,条件可选,若省略则删除所有数据。例如,`DELETE FROM emp WHERE dept_id = 10` 删除10号部门员工。`TRUNCATE` 表名更快,用于清空表,但不支持条件,且数据不可恢复。子查询可用于`CREATE TABLE AS SELECT`来复制表,或在`INSERT`, `UPDATE`语句中进行复杂操作,如更新特定区域员工的工资。
8 1
|
8月前
|
存储 SQL NoSQL
|
9月前
|
存储 安全 数据挖掘
数据库视频
数据库视频
75 0
|
9月前
|
存储 消息中间件 NoSQL
数据库常识课
数据库常识课
50 0
|
10月前
|
SQL 数据库
数据库知识与技巧日常汇总
数据库知识与技巧日常汇总
77 0
|
10月前
|
关系型数据库 MySQL 数据库
|
12月前
|
存储 SQL Oracle
数据库(一)
数据库(一)
51 0
|
SQL 存储 XML
一、初识数据库
将大量数据保存起来,使用计算机加工而成的可以进行高效访问的数据集合。称为database,DB。 用来管理数据库的计算机系统称为DBMS
|
SQL XML 数据库