· 6 years ago · Apr 13, 2019, 10:36 PM
1
2pi@JessCloud:~ $ sudo apt-get install mysql-server
3Reading package lists... Done
4Building dependency tree
5Reading state information... Done
6The following additional packages will be installed:
7 default-mysql-server galera-3 libaio1 libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl libencode-locale-perl libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl
8 libhttp-date-perl libhttp-message-perl libio-html-perl libjemalloc1 liblwp-mediatypes-perl libmariadbclient18 libreadline5 libterm-readkey-perl libtimedate-perl liburi-perl mariadb-client-10.1 mariadb-client-core-10.1 mariadb-common
9 mariadb-server-10.1 mariadb-server-core-10.1 mysql-common socat
10Suggested packages:
11 libclone-perl libmldbm-perl libnet-daemon-perl libsql-statement-perl libdata-dump-perl libipc-sharedcache-perl libwww-perl mailx mariadb-test tinyca
12The following NEW packages will be installed:
13 default-mysql-server galera-3 libaio1 libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl libencode-locale-perl libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl
14 libhttp-date-perl libhttp-message-perl libio-html-perl libjemalloc1 liblwp-mediatypes-perl libmariadbclient18 libreadline5 libterm-readkey-perl libtimedate-perl liburi-perl mariadb-client-10.1 mariadb-client-core-10.1 mariadb-common
15 mariadb-server-10.1 mariadb-server-core-10.1 mysql-common mysql-server socat
160 upgraded, 31 newly installed, 0 to remove and 0 not upgraded.
17Need to get 7,314 B/22.8 MB of archives.
18After this operation, 172 MB of additional disk space will be used.
19Do you want to continue? [Y/n] Y
20Get:2 http://raspbian.raspberrypi.org/raspbian stretch/main armhf mysql-server armhf 5.5.9999+default [1,706 B]
21Get:1 http://archive-bm.raspbian.org/raspbian stretch/main armhf mysql-common all 5.8+1.0.2 [5,608 B]
22Fetched 7,314 B in 0s (20.4 kB/s)
23Extracting templates from packages: 100%
24Preconfiguring packages ...
25Selecting previously unselected package mysql-common.
26(Reading database ... 81805 files and directories currently installed.)
27Preparing to unpack .../00-mysql-common_5.8+1.0.2_all.deb ...
28Unpacking mysql-common (5.8+1.0.2) ...
29Selecting previously unselected package mariadb-common.
30Preparing to unpack .../01-mariadb-common_10.1.37-0+deb9u1_all.deb ...
31Unpacking mariadb-common (10.1.37-0+deb9u1) ...
32Selecting previously unselected package galera-3.
33Preparing to unpack .../02-galera-3_25.3.19-2+rpi1_armhf.deb ...
34Unpacking galera-3 (25.3.19-2+rpi1) ...
35Selecting previously unselected package libdbi-perl.
36Preparing to unpack .../03-libdbi-perl_1.636-1+b1_armhf.deb ...
37Unpacking libdbi-perl (1.636-1+b1) ...
38Selecting previously unselected package libaio1:armhf.
39Preparing to unpack .../04-libaio1_0.3.110-3_armhf.deb ...
40Unpacking libaio1:armhf (0.3.110-3) ...
41Selecting previously unselected package libreadline5:armhf.
42Preparing to unpack .../05-libreadline5_5.2+dfsg-3_armhf.deb ...
43Unpacking libreadline5:armhf (5.2+dfsg-3) ...
44Selecting previously unselected package mariadb-client-core-10.1.
45Preparing to unpack .../06-mariadb-client-core-10.1_10.1.37-0+deb9u1_armhf.deb ...
46Unpacking mariadb-client-core-10.1 (10.1.37-0+deb9u1) ...
47Selecting previously unselected package libconfig-inifiles-perl.
48Preparing to unpack .../07-libconfig-inifiles-perl_2.94-1_all.deb ...
49Unpacking libconfig-inifiles-perl (2.94-1) ...
50Selecting previously unselected package libjemalloc1.
51Preparing to unpack .../08-libjemalloc1_3.6.0-9.1_armhf.deb ...
52Unpacking libjemalloc1 (3.6.0-9.1) ...
53Selecting previously unselected package mariadb-client-10.1.
54Preparing to unpack .../09-mariadb-client-10.1_10.1.37-0+deb9u1_armhf.deb ...
55Unpacking mariadb-client-10.1 (10.1.37-0+deb9u1) ...
56Selecting previously unselected package mariadb-server-core-10.1.
57Preparing to unpack .../10-mariadb-server-core-10.1_10.1.37-0+deb9u1_armhf.deb ...
58Unpacking mariadb-server-core-10.1 (10.1.37-0+deb9u1) ...
59Selecting previously unselected package socat.
60Preparing to unpack .../11-socat_1.7.3.1-2+deb9u1_armhf.deb ...
61Unpacking socat (1.7.3.1-2+deb9u1) ...
62Setting up mysql-common (5.8+1.0.2) ...
63update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
64Setting up mariadb-common (10.1.37-0+deb9u1) ...
65update-alternatives: using /etc/mysql/mariadb.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
66Selecting previously unselected package mariadb-server-10.1.
67(Reading database ... 82200 files and directories currently installed.)
68Preparing to unpack .../00-mariadb-server-10.1_10.1.37-0+deb9u1_armhf.deb ...
69Unpacking mariadb-server-10.1 (10.1.37-0+deb9u1) ...
70Selecting previously unselected package default-mysql-server.
71Preparing to unpack .../01-default-mysql-server_1.0.2_all.deb ...
72Unpacking default-mysql-server (1.0.2) ...
73Selecting previously unselected package libhtml-tagset-perl.
74Preparing to unpack .../02-libhtml-tagset-perl_3.20-3_all.deb ...
75Unpacking libhtml-tagset-perl (3.20-3) ...
76Selecting previously unselected package liburi-perl.
77Preparing to unpack .../03-liburi-perl_1.71-1_all.deb ...
78Unpacking liburi-perl (1.71-1) ...
79Selecting previously unselected package libhtml-parser-perl.
80Preparing to unpack .../04-libhtml-parser-perl_3.72-3_armhf.deb ...
81Unpacking libhtml-parser-perl (3.72-3) ...
82Selecting previously unselected package libcgi-pm-perl.
83Preparing to unpack .../05-libcgi-pm-perl_4.35-1_all.deb ...
84Unpacking libcgi-pm-perl (4.35-1) ...
85Selecting previously unselected package libfcgi-perl.
86Preparing to unpack .../06-libfcgi-perl_0.78-2_armhf.deb ...
87Unpacking libfcgi-perl (0.78-2) ...
88Selecting previously unselected package libcgi-fast-perl.
89Preparing to unpack .../07-libcgi-fast-perl_1%3a2.12-1_all.deb ...
90Unpacking libcgi-fast-perl (1:2.12-1) ...
91Selecting previously unselected package libmariadbclient18:armhf.
92Preparing to unpack .../08-libmariadbclient18_10.1.37-0+deb9u1_armhf.deb ...
93Unpacking libmariadbclient18:armhf (10.1.37-0+deb9u1) ...
94Selecting previously unselected package libdbd-mysql-perl.
95Preparing to unpack .../09-libdbd-mysql-perl_4.041-2_armhf.deb ...
96Unpacking libdbd-mysql-perl (4.041-2) ...
97Selecting previously unselected package libencode-locale-perl.
98Preparing to unpack .../10-libencode-locale-perl_1.05-1_all.deb ...
99Unpacking libencode-locale-perl (1.05-1) ...
100Selecting previously unselected package libhtml-template-perl.
101Preparing to unpack .../11-libhtml-template-perl_2.95-2_all.deb ...
102Unpacking libhtml-template-perl (2.95-2) ...
103Selecting previously unselected package libtimedate-perl.
104Preparing to unpack .../12-libtimedate-perl_2.3000-2_all.deb ...
105Unpacking libtimedate-perl (2.3000-2) ...
106Selecting previously unselected package libhttp-date-perl.
107Preparing to unpack .../13-libhttp-date-perl_6.02-1_all.deb ...
108Unpacking libhttp-date-perl (6.02-1) ...
109Selecting previously unselected package libio-html-perl.
110Preparing to unpack .../14-libio-html-perl_1.001-1_all.deb ...
111Unpacking libio-html-perl (1.001-1) ...
112Selecting previously unselected package liblwp-mediatypes-perl.
113Preparing to unpack .../15-liblwp-mediatypes-perl_6.02-1_all.deb ...
114Unpacking liblwp-mediatypes-perl (6.02-1) ...
115Selecting previously unselected package libhttp-message-perl.
116Preparing to unpack .../16-libhttp-message-perl_6.11-1_all.deb ...
117Unpacking libhttp-message-perl (6.11-1) ...
118Selecting previously unselected package libterm-readkey-perl.
119Preparing to unpack .../17-libterm-readkey-perl_2.37-1_armhf.deb ...
120Unpacking libterm-readkey-perl (2.37-1) ...
121Selecting previously unselected package mysql-server.
122Preparing to unpack .../18-mysql-server_5.5.9999+default_armhf.deb ...
123Unpacking mysql-server (5.5.9999+default) ...
124Setting up libhtml-tagset-perl (3.20-3) ...
125Setting up libconfig-inifiles-perl (2.94-1) ...
126Setting up libencode-locale-perl (1.05-1) ...
127Setting up libjemalloc1 (3.6.0-9.1) ...
128Setting up libtimedate-perl (2.3000-2) ...
129Setting up socat (1.7.3.1-2+deb9u1) ...
130Setting up libio-html-perl (1.001-1) ...
131Setting up libmariadbclient18:armhf (10.1.37-0+deb9u1) ...
132Setting up libterm-readkey-perl (2.37-1) ...
133Setting up liblwp-mediatypes-perl (6.02-1) ...
134Processing triggers for libc-bin (2.24-11+deb9u4) ...
135Setting up libaio1:armhf (0.3.110-3) ...
136Setting up galera-3 (25.3.19-2+rpi1) ...
137Setting up liburi-perl (1.71-1) ...
138Processing triggers for systemd (232-25+deb9u11) ...
139Setting up libhtml-parser-perl (3.72-3) ...
140Setting up libcgi-pm-perl (4.35-1) ...
141Processing triggers for man-db (2.7.6.1-2) ...
142Setting up libreadline5:armhf (5.2+dfsg-3) ...
143Setting up libfcgi-perl (0.78-2) ...
144Setting up libdbi-perl (1.636-1+b1) ...
145Setting up libhttp-date-perl (6.02-1) ...
146Setting up mariadb-server-core-10.1 (10.1.37-0+deb9u1) ...
147Setting up libhtml-template-perl (2.95-2) ...
148Setting up mariadb-client-core-10.1 (10.1.37-0+deb9u1) ...
149Setting up libcgi-fast-perl (1:2.12-1) ...
150Setting up libhttp-message-perl (6.11-1) ...
151Setting up libdbd-mysql-perl (4.041-2) ...
152Setting up mariadb-client-10.1 (10.1.37-0+deb9u1) ...
153Setting up mariadb-server-10.1 (10.1.37-0+deb9u1) ...
154Created symlink /etc/systemd/system/mysql.service → /lib/systemd/system/mariadb.service.
155Created symlink /etc/systemd/system/mysqld.service → /lib/systemd/system/mariadb.service.
156Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /lib/systemd/system/mariadb.service.
157Setting up default-mysql-server (1.0.2) ...
158Setting up mysql-server (5.5.9999+default) ...
159Processing triggers for libc-bin (2.24-11+deb9u4) ...
160Processing triggers for systemd (232-25+deb9u11) ...
161pi@JessCloud:~ $ mysql_secure_installation
162
163NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
164 SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
165
166In order to log into MariaDB to secure it, we'll need the current
167password for the root user. If you've just installed MariaDB, and
168you haven't set the root password yet, the password will be blank,
169so you should just press enter here.
170
171Enter current password for root (enter for none):
172ERROR 1698 (28000): Access denied for user 'root'@'localhost'
173Enter current password for root (enter for none):
174ERROR 1698 (28000): Access denied for user 'root'@'localhost'
175Enter current password for root (enter for none):
176ERROR 1698 (28000): Access denied for user 'root'@'localhost'
177Enter current password for root (enter for none):
178ERROR 1698 (28000): Access denied for user 'root'@'localhost'
179Enter current password for root (enter for none):
180ERROR 1698 (28000): Access denied for user 'root'@'localhost'
181Enter current password for root (enter for none):
182ERROR 1698 (28000): Access denied for user 'root'@'localhost'
183Enter current password for root (enter for none):
184ERROR 1698 (28000): Access denied for user 'root'@'localhost'
185Enter current password for root (enter for none):
186ERROR 1698 (28000): Access denied for user 'root'@'localhost'
187Enter current password for root (enter for none):
188ERROR 1698 (28000): Access denied for user 'root'@'localhost'
189Enter current password for root (enter for none):
190ERROR 1698 (28000): Access denied for user 'root'@'localhost'
191Enter current password for root (enter for none):
192ERROR 1698 (28000): Access denied for user 'root'@'localhost'
193Enter current password for root (enter for none):
194Aborting!
195
196Cleaning up...
197pi@JessCloud:~ $ sudo mkdir /var/run/mysqld; sudo chown mysql /var/run/mysqld
198mkdir: cannot create directory ‘/var/run/mysqld’: File exists
199pi@JessCloud:~ $ sudo mysqld_safe --skip-grant-tables&
200[1] 5037
201pi@JessCloud:~ $ 190413 23:22:23 mysqld_safe Logging to syslog.
202190413 23:22:23 mysqld_safe A mysqld process already exists
203
204[1]+ Exit 1 sudo mysqld_safe --skip-grant-tables
205pi@JessCloud:~ $ sudo mysql --user=root mysql
206Reading table information for completion of table and column names
207You can turn off this feature to get a quicker startup with -A
208
209Welcome to the MariaDB monitor. Commands end with ; or \g.
210Your MariaDB connection id is 13
211Server version: 10.1.37-MariaDB-0+deb9u1 Raspbian 9.0
212
213Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
214
215Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
216
217MariaDB [mysql]> update user set authentication_string=PASSWORD('new-password') where user='root';
218Query OK, 1 row affected (0.00 sec)
219Rows matched: 1 Changed: 1 Warnings: 0
220
221MariaDB [mysql]> flush privileges;
222Query OK, 0 rows affected (0.01 sec)
223
224MariaDB [mysql]> update user set authentication_string=PASSWORD('new-password') where user='root';
225Query OK, 0 rows affected (0.00 sec)
226Rows matched: 1 Changed: 0 Warnings: 0
227
228MariaDB [mysql]> update user set authentication_string=PASSWORD('**********') where user='root';
229Query OK, 1 row affected (0.00 sec)
230Rows matched: 1 Changed: 1 Warnings: 0
231
232MariaDB [mysql]> flush privileges;
233Query OK, 0 rows affected (0.00 sec)
234
235MariaDB [mysql]> exit
236Bye
237pi@JessCloud:~ $ sudo service mysql stop
238pi@JessCloud:~ $ sudo service mysql start
239pi@JessCloud:~ $ sudo mysqladmin shutdown
240pi@JessCloud:~ $ mysql -u root -p
241Enter password:
242ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
243pi@JessCloud:~ $ ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
244-bash: syntax error near unexpected token `('
245pi@JessCloud:~ $ sudo service mysql start
246pi@JessCloud:~ $ mysql -u root -p *********
247Enter password:
248ERROR 1698 (28000): Access denied for user 'root'@'localhost'
249pi@JessCloud:~ $ ERROR 1698 (28000): Access denied for user 'root'@'localhost'
250-bash: syntax error near unexpected token `('
251pi@JessCloud:~ $