Anda di halaman 1dari 2

https://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization-mysqld.

html

INSTALLING
===================================================================

1. extract source
[mysql@centos1 apps]$ unzip p22077804_570_Linux-x86-64.zip
[mysql@centos1 apps]$ gunzip mysql-advanced-5.7.9-linux-glibc2.5-
x86_64.tar.gz
[mysql@centos1 apps]$ tar -xvf mysql-advanced-5.7.9-linux-glibc2.5-x86_64.tar
2. chmod datadir :
drwxr-xr-x. 2 mysql dba 4.0K Oct 28 12:01 data
[mysql@centos1 /]$ chmod 770 /data
drwxrwx---. 2 mysql dba 4.0K Oct 28 12:01 data
3. initialize datadir : ---> ./bin/mysqld --defaults-
file=/data/mysql/config/my3316.cnf --initialize --basedir=/data/mysql/apps/mysql57
--datadir=/data/mysql/datamysql/3316 --user=mysql
[mysql@centos1 mysql]$ bin/mysqld --initialize --basedir=/apps/mysql
--datadir=/data/mysql --user=mysql
2015-10-28T05:22:28.992991Z 0 [Warning] Changed limits: max_open_files: 1024
(requested 5000)
2015-10-28T05:22:28.993146Z 0 [Warning] Changed limits: table_open_cache: 431
(requested 2000)
2015-10-28T05:22:28.993662Z 0 [Warning] TIMESTAMP with implicit DEFAULT value
is deprecated. Please use --explicit_defaults_for_timestamp server option (see
documentation for more details).
2015-10-28T05:22:29.639487Z 0 [Warning] InnoDB: New log files created,
LSN=45790
2015-10-28T05:22:29.788689Z 0 [Warning] InnoDB: Creating foreign key
constraint system tables.
2015-10-28T05:22:30.165953Z 0 [Warning] No existing UUID has been found, so
we assume that this is the first time that this server has been started. Generating
a new UUID: e2823fdb-7d33-11e5-bd71-08002798cb77.
2015-10-28T05:22:30.207080Z 0 [Warning] Gtid table is not ready to be used.
Table 'mysql.gtid_executed' cannot be opened.
2015-10-28T05:22:31.658379Z 0 [Warning] CA certificate ca.pem is self signed.
2015-10-28T05:22:31.812644Z 1 [Note] A temporary password is generated for
root@localhost: qs>eq&>Sg7va

untuk bisa tapa di gerate passwordnya:


shell> bin/mysqld --initialize-insecure --user=mysql

4. start mysql :
[mysql@centos1 mysql]$ bin/mysqld_safe --defaults-file=/data/my.cnf
--user=mysql &
[1] 3109
[mysql@centos1 mysql]$ 151028 12:23:00 mysqld_safe Logging to
'/data/mysql/centos1.localdomain.err'.
151028 12:23:00 mysqld_safe Starting mysqld daemon with databases from
/data/mysql
5. login mysql :
[mysql@centos1 mysql]$ mysql -u root -h 127.0.0.1 -p
Enter password: <--- coba no password
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using
password: NO)
[mysql@centos1 mysql]$
[mysql@centos1 mysql]$ mysql -u root -h 127.0.0.1 -p
Enter password: <--- qs>eq&>Sg7va
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.9-enterprise-commercial-advanced
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
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 input
statement.
mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement
before executing this statement.

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'root123';


Query OK, 0 rows affected (0.04 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.09 sec)

6. ls datadir :
[mysql@centos1 mysql]$ ls -lrth
total 121M
-rw-r-----. 1 mysql users 48M Oct 28 12:22 ib_logfile1
-rw-r-----. 1 mysql users 56 Oct 28 12:22 auto.cnf
-rw-------. 1 mysql users 1.7K Oct 28 12:22 ca-key.pem
-rw-r--r--. 1 mysql users 1.1K Oct 28 12:22 ca.pem
-rw-------. 1 mysql users 1.7K Oct 28 12:22 server-key.pem
-rw-r--r--. 1 mysql users 1.1K Oct 28 12:22 server-cert.pem
-rw-------. 1 mysql users 1.7K Oct 28 12:22 client-key.pem
-rw-r--r--. 1 mysql users 1.1K Oct 28 12:22 client-cert.pem
-rw-r--r--. 1 mysql users 452 Oct 28 12:22 public_key.pem
-rw-------. 1 mysql users 1.7K Oct 28 12:22 private_key.pem
drwxr-x---. 2 mysql users 4.0K Oct 28 12:22 performance_schema
drwxr-x---. 2 mysql users 4.0K Oct 28 12:22 mysql
drwxr-x---. 2 mysql users 12K Oct 28 12:22 sys
-rw-r-----. 1 mysql users 407 Oct 28 12:22 ib_buffer_pool
-rw-rw----. 1 mysql users 5 Oct 28 12:23 mysqld_safe.pid
-rw-r-----. 1 mysql users 5 Oct 28 12:23 centos1.localdomain.pid
-rw-r-----. 1 mysql users 12M Oct 28 12:23 ibtmp1
-rw-r-----. 1 mysql users 12M Oct 28 12:23 ibdata1
-rw-r-----. 1 mysql users 48M Oct 28 12:23 ib_logfile0
-rw-r-----. 1 mysql users 4.7K Oct 28 12:24 centos1.localdomain.err