summaryrefslogtreecommitdiff
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
* mysql_install_db: correct hosting/source/maillist informationDaniel Black2018-01-231-2/+2
|
* mysql_install_db: correct --skip-grant-tables helpDaniel Black2018-01-231-1/+1
|
* Fixed mysql_install_db --no-defaultsSergey Vojtovich2018-01-131-6/+9
| | | | Regression after 5ea2801.
* mysql_install_db: Use --defaults-group-suffix if specifiedDaniel Black2018-01-121-2/+5
| | | | Signed-off-by: Daniel Black <daniel@linux.vnet.ibm.com>
* MDEV-14337 mysqld_safe may suppress error messages with --log-output=fileSergei Golubchik2017-11-101-2/+2
| | | | | don't close stdout/stderr, redirect them to /dev/null instead. otherwise redirections like >&2 fail with "invalid file descriptor"
* MDEV-13440 mysql_install_db fails with hard-coded langdirSergei Golubchik2017-10-171-4/+4
| | | | | | | always search in compile-time specified paths INSTALL_BINDIR, INSTALL_SBINDIR, INSTALL_MYSQLSHAREDIR. User can set them to arbitrary values, it's not enough to search only in their usual values of bin, sbin and libexec, share and share/mysql.
* cleanup mysql_install_dbSergei Golubchik2017-10-172-23/+30
| | | | | | | | | | 1. detect resolveip location, don' assume it's in $basedir/bin 2. don't guess $scriptdir to (incorrectly) construct the $0 path 3. rename find_in_basedir -> find_in_dirs, don't prepend $basedir automatically. This allows to use identical path lists in find_in_dirs and in cannot_find_file. 4. move search path lists to CMakeLists.txt to avoid specifying the same path list twice (in find_in_dirs and in cannot_find_file).
* Merge remote-tracking branch 'mysql/5.5' into 5.5Sergei Golubchik2017-07-1814-63/+46
|\
| * Bug #25436469: BUILDS ARE NOT REPRODUCIBLETor Didriksen2017-05-161-0/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport to 5.5 Current MySQL builds, even on Pushbuild, are not reproducible; they return different results depending on which directory they are built from (and Pushbuild uses several different directories). This is because absolute paths leak into debug information, and even worse, __FILE__. The latter moves code around enough that we've actually seen sysbench changes on the order of 4% in some tests. CMake seemingly insists on using absolute paths, but we can insert our own layer between CMake and GCC to relativize all paths. Also give the right flags to get debug information reproducible and turn off build stamping. This makes the mysqld build 100% bit-for-bit reproducible between runs on my machine, even when run from different directories.
| * Bug#25043674 - MYSQLACCESS SCRIPT LOADS AND EXECUTES CODEShishir Jaiswal2017-04-171-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FROM THE CURRENT DIRECTORY DESCRIPTION =========== When 'mysqlaccess' tool is run, it reads (and executes) the content of its configuration file 'mysqlaccess.conf' from the current directory. This is not a recommended behaviour as someone with ill intentions can insert malicious instructions into this file which could be executed whenever this tool is run. ANALYSIS ======== The configuration file is presently looked for, in the following folders (in given order): 1. Current directory 2. SYSCONFDIR //This gets expanded 3. /etc/ Owing to the reasons mentioned above, we should not permit the file to be in the current directory. Since the other two folders are assumed to be accessible only to authorized people, the config file is safe to be read from there. FIX === Modified the script so that it looks for the config file now in the following two folders (in the given order): 1. SYSCONFDIR 2. /etc/ If it's absent from above locations but present in current directory, an error is thrown asking the user to move the file to one of the above locations and retry. NOTE ==== The location paths and their precedence are not documented for this tool. It needs to be noted as part of the associated documentation.
| * BUG#25719975 SHEBANG HARD CODED AS /USR/BIN/PERL IN SCRIPTS, BREAKS ON FREEBSDTerje Rosten2017-03-2815-38/+33
| | | | | | | | Use cmake variable to adjust shebang to platform.
| * BUG#25364806 MYSQLD_SAFE FAILING TO START IF DATADIR GIVEN IS NOT ABSOLUTE PATHTerje Rosten2017-03-091-2/+8
| | | | | | | | | | | | | | | | | | mysqld_safe is working on real files, however passing these file paths as is to mysqld as options gives different meaning when paths are relative. mysqld_safe uses current working directory as basedir for relative paths, while mysqld uses $datadir as basedir.
* | Merge remote-tracking branch 'mysql/5.5' into 5.5mariadb-5.5.55Sergei Golubchik2017-04-112-20/+48
|\ \ | |/
| * Bug#25144379 MYSQLD PROCESS DOES NOT INCLUDE FULL PATH WHEN STARTING MYSQL ↵Terje Rosten2017-02-131-66/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SERVER Fix of Bug#25088048 caused paths to be relative, not absolute, this proved to be problematic. Fix is to still ignore current working directory, however switch to using full path of basedir, which is set to parent directory of bin/ directory where mysqld_safe is located. References to legacy tool mysql_print_defaults are removed, only my_print_defaults is used these days. This will also fix: Bug#11745176 (11192) MYSQLD_SAFE ONLY EVALUATES --DEFAULTS-FILE OPTION WHEN IT IS THE FIRST OP Bug#23013510 (80866) MYSQLD_SAFE SHOULD NOT SEARCH $MY_BASEDIR_VERSION/VAR AS DATADIR Bug#25244898 (84173) MYSQLD_SAFE --NO-DEFAULTS & SILENTLY DOES NOT WORK ANY MORE Bug#25261472 (84219) INITSCRIPT ERRORS WHEN LAUCHING MYSQLD_SAFE IN NON DEFAULT BASEDIR Bug#25319392 (84263) MYSQL.SERVER (MYSQL SERVER STARTUP SCRIPT) CAN NOT WORK,AND EXPORT SOME ERROR. Bug#25319457 MYSQLD_SAFE MIGHT FAIL IF $DATADIR HAS TRAILING / Bug#25341981 MYSQLD_SAFE ASSUMES INCORRECT BASEDIR WHEN EXECUTED WITH ABSOLUTE PATH Bug#25356221 (84427) MYSQLD_SAFE FAILS TO START WHEN USING A FIFO FOR LOG-ERROR (REGRESSION) Bug#25365194 (84447) MYSQLD_SAFE DOESN'T CHECK EXISTENCE OF GIVEN BASEDIR PARAMETER Bug#25377815 ERRORS WHILE STARTING MYSQLD_SAFE WITH SYM LINK ENABLED
| * Bug#11751149 - TRYING TO START MYSQL WHILE ANOTHER INSTANCEShishir Jaiswal2016-12-221-14/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IS STARTING: CONFUSING ERROR DESCRIPTION =========== When mysql server processes transactions but has not yet committed and shuts down abnormally (due to crash, external killing etc.), a recovery is due from Storage engine side which takes place the next time mysql server (either through mysqld or mysqld_safe) is run. While the 1st server is in mid of recovery, if another instance of mysqld_safe is made to run, it may result into 2nd instance killing the 1st one after a moment. ANALYSIS ======== In the "while true" loop, we've a check (which is done after the server stops) for the existence of pid file to enquire if it was a normal shutdown or not. If the file is absent, it means that the graceful exit of server had removed this file. However if the file is present, the scripts makes a plain assumption that this file is leftover of the "current" server. It misses to consider that it could be a valid pid file belonging to another running mysql server. We need to add more checks in the latter case. The script should extract the PID from this existing file and check if its running or not. If yes, it means an older instance of mysql server is running and hence the script should abort. FIX === Checking the status of process (alive or not) by adding a @CHECK_PID@ in such a case. Aborting if its alive. Detailed logic is as follows: - The mysqld_safe script would quit at start only as soon as it finds that there is an active PID i.e. a mysql server is already running. - The PID file creation takes place after InnoDb recovery, which means in rare case (when PID file isn't created yet) it may happen that more than 1 server can come up but even in that case others will have to wait till the 1st server has released the acquired InnoDb lock. In this case all these servers will either TIMEOUT waiting for InnoDb lock or after this they would find that the 1st server is already running (by reading $pid_file) and would abort. - Our core fix is that we now check the status of mysql server process (alive or not) after the server stops running within the loop of "run -> shutdown/kill/abort -> run ... ", so that only the script who owns the mysql server would be able to bring it down if required. NOTE ==== Removed the deletion of pid file and socket file from entry of the loop, as it may result in 2nd instance deleting these files created by 1st instance in RACE condition. Compensated this by deleting these files at end of the loop Reverted the changes made in patch to Bug#16776528. So after this patch is pushed, the concept of mysqld_safe.pid would go altogether. This was required as the script was deleting other instance's mysqld_safe.pid allowing multiple mysqld_safe instances to run in parallel. This patch would fix Bug#16776528 as well as the resources would be guarded anyway by InnoDb lock + our planned 5.7 patch.
| * Bug#13344753 MYSQL_SECURE_INSTALLATION SCRIPT DOES NOT CHECK USER INPUTTerje Rosten2016-12-191-19/+48
| | | | | | | | | | Loop until valid answer is given. Variants of y,yes and n,no and blank (meaning default) are considered valid.
| * Bug#25088048 ADDITIONAL ISSUES IN MYSQLD_SAFETerje Rosten2016-11-161-2/+16
| | | | | | | | | | | | | | | | | | Don't read --ledir option from config file. Ignore current working for finding location of mysqld Remove use of chown/chmod in scripts. Be helpful only when basedir is /var/log or /var/lib. Removed unused systemd files for SLES. Set explicit basedir in scripts.
| * Bug#24483092 UNSAFE USE OF VARIOUS SHELL UTILITIESTerje Rosten2016-10-062-27/+92
| | | | | | | | | | | | | | | | | | | | - Remove use of touch and chmod. - Restrict usage of chown to cases where target directory is /var/log. - Due to limited feature set in /bin/sh on Solaris, /bin/bash will be used on this platform. - Give error if directory for UNIX socket file is missing. - Privileged user should not log to files owned by different user (mysqld will log as before).
| * Bug#24464380 PRIVILEGE ESCALATION USING MYSQLD_SAFETerje Rosten2016-08-261-2/+2
| | | | | | | | Post push fix: Solaris 10 /bin/sh don't understand $().
| * Bug#24464380 PRIVILEGE ESCALATION USING MYSQLD_SAFETerje Rosten2016-08-181-32/+47
| | | | | | | | | | | | | | Argument to malloc-lib must be included in restricted list of directories, symlink guards added, and mysqld and mysqld-version options restricted to command line only. Don't redirect errors to stderr.
* | mysqld_safe: don't close stdout if set -xSergei Golubchik2017-01-101-2/+7
| |
* | Numerous issues in mysqld_safeSergei Golubchik2016-12-221-63/+44
| |
* | MDEV-11242 MariaDB Server releases contains promotion of MariaDB CorporationSergei Golubchik2016-12-031-4/+2
| |
* | mysqld_safe: close stdout and stderrSergei Golubchik2016-09-291-1/+5
| | | | | | | | | | when they're not needed anymore. Helps when daemonizing it from mysql.init
* | MDEV-10248 Cannot Remove Test TablesElena Stepanova2016-07-152-2/+2
| | | | | | | | While dropping the test database, use IF EXISTS to avoid bogus errors
* | Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2016-06-141-2/+6
|\ \ | |/
| * Bug#19920049 - MYSQLD_MULTI MISLEADING WHEN MY_PRINT_DEFAULTSShishir Jaiswal2016-03-011-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IS NOT FOUND DESCRIPTION =========== If script mysqld_multi and utility my_print_defaults are in the same folder (not included in $PATH) and the former is made to run, it complaints that the mysqld binary is absent eventhough the binary exists. ANALYSIS ======== We've a subroutine my_which() mimicking the behaviour of POSIX "which" command. Its current behaviour is to check for a given argument as follows: - Step 1: Assume the argument to be a command having full fledged absolute path. If it exists "as-is", return the argument (which will be pathname), else proceed to Step 2. - Step 2: Assume the argument to be a plain command with no aboslute path. Try locating it in all of the paths (mentioned in $PATH) one by one. If found return the pathname. If found nowhere, return NULL. Currently when my_which(my_print_defaults) is called, it returns from Step 1 (since utlity exists in current folder) and doesn't proceed to Step 2. This is wrong since the returned value is same as the argument i.e. 'my_print_default' which defies the purpose of this subroutine whose job is to return a pathname either in Step 1 or Step 2. Later when the utility is executed in subroutine defaults_for_group(), it evaluates to NULL and returns the same. This is because the plain command 'my_print_defaults {options} ...' would execute properly only if my_print_defaults exists in one of the paths (in $PATH). In such a case, in the course of the flow it looks onto the variable $mysqld_found which comes out to be NULL and hence ethe error. In this case, call to my_which should fail resulting in script being aborted and thus avoiding this mess. FIX === This utility my_print_defaults should be tested only in Step 2 since it does not have an absolute path. Thus added a condition in Step 1 so that is gets executed iff not called for my_print_defaults thus bypassing it to proceed to Step 2 where the check is made for various paths (in $PATH)
* | MDEV-7341 mysqld_multi doesn't recognize include directive (not following ↵Sergei Golubchik2015-12-071-6/+14
| | | | | | | | includes)
* | Merge remote-tracking branch 'mysql/5.5' into 5.5Sergei Golubchik2015-04-271-1/+1
|\ \ | |/
| * Bug#17619241 SERVICE OR MYSQLD_SAFE STARTS PICKING WRONG PLUGIN DIRECTORYBala2015-01-161-1/+1
| |
* | Merge remote-tracking branch 'bzr/5.5' into bb-5.5-mergeSergei Golubchik2015-02-121-2/+12
|\ \
| * | MDEV-7478 log-basename unpredictable behavior in standalone modeSergei Golubchik2015-02-091-2/+12
| | | | | | | | | | | | | | | * fix /etc/init.d/mysql to use log-basename for pid-filename * fix mysqld_safe not to force logging-to-file when log-basename is specified
* | | Merge remote-tracking branch 'mysql/5.5' into bb-5.5-merge @ mysql-5.5.42Sergei Golubchik2015-02-112-4/+4
|\ \ \ | |/ / |/| / | |/
| * Bug #18957951 RPMBUILD DEPENDENCY SCANNER ADDS DEPENDENCY ON NON-EXISTING ↵Kent Boortz2014-11-062-4/+4
| | | | | | | | | | | | | | | | | | | | PERL "HOSTNAMES" When building RPMs and using the "rpmbuild" automatic scanning for Perl dependencies, it might interpret "use hostnames" in the "mysql_config.pl" script usage comment as a Perl "use" statement. And then makes the resulting RPMs depends on a non-existing module Perl "hostnames". The comment was changed to prevent this.
| * Bug #14486004 MYSQL_SETPERMISSION DOES NOT QUOTE USER NAMESArun Kuruvila2014-10-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Description: Certain operations using the client tool 'mysql\_setpermisson' which uses username of the format "xxx-yyy" results in a syntax error. Analysis: The user name variable ( $user ) was not quoted properly in the 'mysql\_setpermission' script. As a result, while granting user privileges for a user with username of the format 'xxx-yyy', results in a syntax error. Fix: The escape sequence has been applied for the user variable in the script file. Note: Test case is not added for this fix. 'mysql\_setpermission' executable resides in different directories on pb2 machines and on local boxes. Hence the test case cannot be made generic.
| * Bug#17633291: SET PROPER COMPILE OPTIONS FOR CLANGJon Olav Hauglid2014-10-131-4/+8
| | | | | | | | | | | | | | Bug#17959689: MAKE GCC AND CLANG GIVE CONSISTENT COMPILATION WARNINGS Bug#18313717: ENABLE -WERROR IN MAINTANER MODE WHEN COMPILING WITH CLANG Bug#18510941: REMOVE CMAKE WORKAROUNDS FOR OLDER VERSIONS OF OS X/XCODE Backport from mysql-5.6 to mysql-5.5
| * Bug #19361402 - ADD --MANUAL-LLDB OPTION TO MYSQL-TEST-RUN.PL, contributedSayantan Dutta2014-09-021-0/+0
| |
| * Bug #18415196 MYSQL_UPGRADE DUPLICATE KEY ERROR FOR MYSQL.USER FOR 5.5.35+, ↵Venkata Sidagam2014-08-011-2/+0
| | | | | | | | | | 5.6.15+, 5.7.3+ Follow-up patch. Removed unwanted code.
| * Bug #18415196 MYSQL_UPGRADE DUPLICATE KEY ERROR FOR MYSQL.USER FOR 5.5.35+, ↵Venkata Sidagam2014-08-011-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5.6.15+, 5.7.3+ Description: mysql_upgrade fails with below error, when there are duplicate entries(like 'root'@'LOCALHOST' and 'root'@'localhost') in mysql.user table. ERROR 1062 (23000) at line 1140: Duplicate entry 'localhost-root' for key 'PRIMARY' FATAL ERROR: Upgrade failed Analysis: As part of the bug 12917151 fix we are making all the hostnames as lower case hostnames. So, this has been done by mysql_upgrade. In case of above mentioned duplicate entries mysql_upgrade tries to change hostname to lowercase. Since there is already 'root'@'localhost' exists. it is failing with "duplicate entry" error. Fix: Since its a valid error failure. We are making the error more verbose. So, that user will delete the duplicate errors manually. Along with existing error we are printing below error as well. ERROR 1644 (45000) at line 1153: Multiple accounts exist for @user_name, @host_name that differ only in Host lettercase; remove all except one of them
| * Bug#18903155: BACKPORT BUG-18008907 TO 5.5+ VERSIONS.Praveenkumar Hulakund2014-06-271-0/+0
| | | | | | | | Post-push patch. Changing file permission of "scripts/mysqlaccess.conf".
| * Bug#18903155: BACKPORT BUG-18008907 TO 5.5+ VERSIONS.Praveenkumar Hulakund2014-06-271-0/+0
| | | | | | | | | | Backporting patch committed for bug 18008907 to 5.5 and 5.6.
| * Bug#16395459 TEST AND RESULT FILES WITH EXECUTE BITTerje Rosten2014-06-251-0/+0
| | | | | | | | | | | | | | | | | | Bug#16415173 CRLF INSTEAD OF LF IN SQL-BENCH SCRIPTS Correct perms and converts from Windows style to UNIX style line endings on some files. Fix perms on installed ini files. (MySQL 5.5 version)
| * Backport from trunk:Tor Didriksen2014-05-122-3/+5
| | | | | | | | | | | | | | | | | | Bug #18382225 MYSQL_CONFIG CAN'T HANDLE RELOCABLE PACKAGES THAT USES "LIB64" OR "-64" SUFFIX 'lib' is hardcoded into mysql_config, so 'cmake -DINSTALL_LIBDIR=lib64' will not work. Use INSTALL_LIBDIR when generating mysql_config. mysql_config may be renamed to e.g. mysql_config-32, fix the basedir pattern matching.
| * Bug#18235669 MYSQL_CONFIG TO PROVIDE R FLAG ON SOLARISTor Didriksen2014-02-253-7/+15
| | | | | | | | | | | | 'mysql_config --libs' outputs -L/path/to/library on SunOS we also want it to output '-R/path/to/library' in order to find libraries at runtime.
| * Updated/added copyright header. Added line "use is subject to license terms" Murthy Narkedimilli2014-02-175-0/+5
| | | | | | | | to copyright header.
| * Bug#11751526 / Bug#42421 - MYSQL_INSTALL_DB.PL NOT RELOCATABLE ON WINDOWSKent Boortz2014-02-031-3/+3
| | | | | | | | Corrected how to find "resolveip"
| * Updated/added copyright headersMurthy Narkedimilli2014-01-067-8/+7
| |
| * Bug#29716 : Bug#11746921 : MYSQL_INSTALL_DB REFERS TO THE (OBSOLETE) ↵Kent Boortz2013-12-143-8/+9
| | | | | | | | | | | | | | MYSQLBUG SCRIPT DURING INSTALLATION Bug#68742 : Bug#16530527 : OBSOLETE BUGREPORT ADDRESSES
| * Bug #12917164 DROP USER CAN'T DROP USERS WITH LEGACY Venkata Sidagam2013-10-312-4/+5
| |\ | | | | | | | | | UPPER CASE HOST NAME ANYMORE Merging from mysql-5.1 to mysql-5.5
| | * Bug #12917164 DROP USER CAN'T DROP USERS WITH LEGACY Venkata Sidagam2013-10-312-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UPPER CASE HOST NAME ANYMORE Description: It is not possible to drop users with host names with upper case letters in them. i.e DROP USER 'root'@'Tmp_Host_Name'; is failing with error. Analysis: Since the fix 11748570 we came up with lower case hostnames as standard. But in the current bug the hostname is created by mysql_install_db script is still having upper case hostnames. So, if we have the hostname with upper case letters like(Tmp_Host_Name) then we will have as it is stored in the mysql.user table. In this case if use "'DROP USER 'root'@'Tmp_Host_Name';" it gives error because we do compare with the lower case of hostname since the 11748570 fix. Fix: We need to convert the hostname to lower case before storing into the mysql.user table when we run the mysql_install_db script.