smeserver-vtigercrm/root/etc/e-smith/templates/etc/e-smith/sql/init/80vtigercrm_mysql.sql

60 lines
1.9 KiB
SQL

# Vtiger CRM MySQL init template
#
# This files creates/updates Vtiger CRM MySQL database infos
USE mysql;
CREATE DATABASE IF NOT EXISTS { $vtigercrm{DbName} } DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
REPLACE INTO user (
host,
user,
password)
VALUES (
'localhost',
'{ $vtigercrm{DbUser} }',
PASSWORD ('{ $vtigercrm{DbPassword} }'));
REPLACE INTO user (
host,
user,
password)
VALUES (
'%',
'{ $vtigercrm{DbUser} }',
PASSWORD ('{ $vtigercrm{DbPassword} }'));
REPLACE INTO db (
host,
db,
user,
select_priv, insert_priv, update_priv, delete_priv,
create_priv, alter_priv, index_priv, drop_priv, create_tmp_table_priv,
grant_priv, lock_tables_priv, references_priv)
VALUES (
'localhost',
'{ $vtigercrm{DbName} }',
'{ $vtigercrm{DbUser} }',
'Y', 'Y', 'Y', 'Y',
'Y', 'Y', 'Y', 'Y', 'Y',
'N', 'Y', 'Y');
REPLACE INTO db (
host,
db,
user,
select_priv, insert_priv, update_priv, delete_priv,
create_priv, alter_priv, index_priv, drop_priv, create_tmp_table_priv,
grant_priv, lock_tables_priv, references_priv)
VALUES (
'%',
'{ $vtigercrm{DbName} }',
'{ $vtigercrm{DbUser} }',
'Y', 'Y', 'Y', 'Y',
'Y', 'Y', 'Y', 'Y', 'Y',
'N', 'Y', 'Y');
FLUSH PRIVILEGES;