Quelle mariadb_system_tables_data.sql
Sprache: SQL
-- Copyright (c) 2007, 2013, Oracle and/or its affiliates. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; version 2 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
-- -- The initial data for system tables of MySQL Server --
SET NAMES latin1 COLLATE latin1_swedish_ci;
-- When setting up a "cross bootstrap" database (e.g., creating data on a Unix -- host which will later be included in a Windows zip file), any lines -- containing "@current_hostname" are filtered out by mysql_install_db.
-- Get the hostname, if the hostname has any wildcard character like "_" or "%" -- add escape character in front of wildcard character to convert "_" or "%" to -- a plain character SELECT LOWER( REPLACE((SELECTREPLACE(@@hostname,'_','\_')),'%','\%') )INTO @current_hostname; SELECT'{"access":18446744073709551615}'INTO @all_privileges; SELECT'{"access":18446744073709551615,"plugin":"mysql_native_password","authentication_string":"invalid","auth_or":[{},{"plugin":"unix_socket"}]}'into @all_with_auth;
-- Fill "global_priv" table with default users allowing root access -- from local machine if "global_priv" table didn't exist before CREATE TEMPORARY TABLE tmp_user_nopasswd LIKE global_priv; CREATE TEMPORARY TABLE tmp_user_socket LIKE global_priv; -- Classic passwordless root account. INSERTINTO tmp_user_nopasswd VALUES ('localhost','root',@all_privileges); REPLACEINTO tmp_user_nopasswd SELECT @current_hostname,'root',@all_privileges FROMdualWHERE @current_hostname != 'localhost'; REPLACEINTO tmp_user_nopasswd VALUES ('127.0.0.1','root',@all_privileges); REPLACEINTO tmp_user_nopasswd VALUES ('::1','root',@all_privileges); -- More secure root account using unix socket auth. INSERTINTO tmp_user_socket VALUES ('localhost', 'root',@all_with_auth); REPLACEINTO tmp_user_socket VALUES ('localhost',IFNULL(@auth_root_socket, 'root'),@all_with_auth); IF @auth_root_socket isnotnullTHEN IFnotexists(select1from information_schema.plugins where plugin_name='unix_socket') THEN
INSTALL SONAME'auth_socket'; END IF; END IF;
INSERTINTO global_priv SELECT * FROM tmp_user_nopasswd WHERE @had_user_table=0AND @auth_root_socket ISNULL; INSERTINTO global_priv SELECT * FROM tmp_user_socket WHERE @had_user_table=0AND @auth_root_socket ISNOTNULL;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.