File tree Expand file tree Collapse file tree 2 files changed +6
-24
lines changed Expand file tree Collapse file tree 2 files changed +6
-24
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,6 @@ All notable changes to this project will be documented in this file.
4
4
5
5
## Unreleased
6
6
7
- Fix #715 : Update ` db_initialized? ` to be based on database connection instead of file existence
8
-
9
7
## 11.1.9 - * 2024-12-09*
10
8
11
9
## 11.1.8 - * 2024-11-18*
@@ -663,7 +661,7 @@ Adding Ubuntu 13.04 to Platforminfo
663
661
- ** [ COOK-2966] - Address foodcritic failures'
664
662
- ** [ COOK-4182] - Template parse failure in /etc/init/mysql.conf (data_dir)'
665
663
- ** [ COOK-4198] - Added missing tunable'
666
- - ** [ COOK-4206
] - create
` [email protected] ` , as well as
` root@localhost ` '
664
+ - ** [ COOK-4206
] - create
[email protected] , as well as root@localhost'
667
665
668
666
## [ 4.0.20] - 2014-01-18
669
667
Original file line number Diff line number Diff line change @@ -257,21 +257,11 @@ def db_init
257
257
end
258
258
259
259
def db_initialized?
260
- cmd = shell_out ( "test \" #{ db_initialized_check_cmd } \" -gt 0" , user : 'root' )
261
- cmd . exitstatus == 0
262
- end
263
-
264
- def db_initialized_check_cmd
265
- # If MySQL is running, mysqladmin ping will return 0 even with invalid credentials
266
- # if MySQL is not running, mysqladmin will return 1 even with valid credentials
267
- cmd = mysqladmin_bin
268
- cmd << ' --user=UNKNOWN_MYSQL_USER'
269
- cmd << ' ping > /dev/null 2>&1 &&'
270
- cmd << " #{ mysql_client_bin } #{ defaults_file } "
271
- cmd << ' --skip-column-names --batch'
272
- cmd << " --execute=\" SELECT count(*) FROM mysql.db WHERE db LIKE 'test%'\" "
273
- return "scl enable #{ scl_name } \" #{ cmd } \" " if scl_package?
274
- cmd
260
+ if v80plus
261
+ ::File . exist? "#{ data_dir } /mysql.ibd"
262
+ else
263
+ ::File . exist? "#{ data_dir } /mysql/user.frm"
264
+ end
275
265
end
276
266
277
267
def mysql_install_db_bin
@@ -289,12 +279,6 @@ def mysql_install_db_cmd
289
279
cmd
290
280
end
291
281
292
- def mysql_client_bin
293
- return "#{ prefix_dir } /bin/mysql" if platform_family? ( 'smartos' )
294
- return 'mysql' if scl_package?
295
- "#{ prefix_dir } /usr/bin/mysql"
296
- end
297
-
298
282
def mysqladmin_bin
299
283
return "#{ prefix_dir } /bin/mysqladmin" if platform_family? ( 'smartos' )
300
284
return 'mysqladmin' if scl_package?
You can’t perform that action at this time.
0 commit comments