ashokgelal / townhouse

A multi-tenant Laravel app for listing property rentals
https://medium.com/@ashokgelal/writing-a-full-featured-multi-tenant-laravel-app-from-scratch-a0e1a7350d9d
253 stars 86 forks source link

MariaDB --error on command CreateTenant #15

Open weblikero opened 6 years ago

weblikero commented 6 years ago

Hi I have an error when I create a tenant from console:

php artisan tenant:create boise boise@example.com

Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'IF NOT EXISTS 51d58fb26e6a436b83e835a3cbbb432b@'127.0.0.1' IDENTIFIED BY '1ce8' at line 1 (SQL: CREATE USER IF NOT EXISTS 51d58fb26e6a436b83e835a3cbbb432b@'127.0.0.1' IDENTIFIED BY '1ce8cd62c029a370c4b063151678c542')

at /home/user/Apps/workshop_proj/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664 660| // If an exception occurs when attempting to run a query, we'll format the error 661| // message to include the bindings with SQL, which will make this exception a 662| // lot more helpful to the developer instead of just the database's errors. 663| catch (Exception $e) {

664| throw new QueryException( 665| $query, $this->prepareBindings($bindings), $e 666| ); 667| } 668|

Exception trace:

1 Doctrine\DBAL\Driver\PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'IF NOT EXISTS 51d58fb26e6a436b83e835a3cbbb432b@'127.0.0.1' IDENTIFIED BY '1ce8' at line 1") /home/user/Apps/workshop_proj/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:82

2 PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'IF NOT EXISTS 51d58fb26e6a436b83e835a3cbbb432b@'127.0.0.1' IDENTIFIED BY '1ce8' at line 1") /home/user/Apps/workshop_proj/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:80

Please use the argument -v to see more details.

weblikero commented 6 years ago

My mistake...Read the requirments....>MariaDB 10.x