question stringlengths 11 28.2k | answer stringlengths 26 27.7k | tag stringclasses 130
values | question_id int64 935 78.4M | score int64 10 5.49k |
|---|---|---|---|---|
I installed mysql through yum just now and the OS fedora installed mariadb for me.
I know mariadb is a new branch of mysql, but I can't understand why it does not ask me for setting the password.
I have tried for 123456 and so on, but I failed.
My fedora is new, and this is the first time to install mysql/mariadb.
Wha... | I had the same problem. It's true the password is empty, but even so the error message is shown. The solution is just using "sudo"
so
$ sudo mysql
will open the mysql tool
For securing the database, you should use sudo again.
$ sudo mysql_secure_installation
| MariaDB | 20,270,879 | 105 |
I want to know how to check whether MySQL strict mode is on or off in localhost(xampp).
If on then for what modes and how to off.
If off then how to on.
I already followed http://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sql-mode-full and https://mariadb.com/kb/en/mariadb/sql_mode/ and other related sites too. But ... | ->STRICT_TRANS_TABLES is responsible for setting MySQL strict mode.
->To check whether strict mode is enabled or not run the below sql:
SHOW VARIABLES LIKE 'sql_mode';
If one of the value is STRICT_TRANS_TABLES, then strict mode is enabled, else not.
In my case it gave
+--------------+---------------------------------... | MariaDB | 40,881,773 | 96 |
As part of our introduction to computer security course, we have a short unit on SQL injections. One of the homework assignments is a basic unsanitized login page. The expected solution is something along the lines of the classic ' or 1=1; -- , but we always welcome students to find unconventional solutions.
One such s... | This specific SQL injection uses two aspects:
First, -- without the space, together with a value behind it, is parsed as a subtraction of a negative number. When you run the query
SELECT '10'--'9'
You will get the following result:
+-----------+
| '10'--'9' | //Interpreted as 10 minus -9 (negating the negative)
+----... | MariaDB | 78,431,167 | 73 |
When migrating my DB, this error appears. Below is my code followed by the error that I am getting when trying to run the migration.
Code
public function up()
{
Schema::create('meals', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->int... | When creating a new table in Laravel. A migration will be generated like:
$table->bigIncrements('id');
Instead of (in older Laravel versions):
$table->increments('id');
When using bigIncrements the foreign key expects a bigInteger instead of an integer. So your code will look like this:
public function up()
{
... | MariaDB | 32,669,880 | 71 |
I am getting this error for my Java code
Caused by :`com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException`: 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 'type = `MyISAM`' at line 1
This is the query passed by hibernate:... | The problem is that - in Hibernate 5.x and earlier - the dialect org.hibernate.dialect.MySQLDialect is for MySQL 4.x or earlier. The fragment TYPE=MYISAM that is generated by this dialect was deprecated in MySQL 4.0 and removed in 5.5.
Given that you use MariaDB, you need to use (depending on the version of MariaDB and... | MariaDB | 43,716,068 | 61 |
I logged into MariaDB/MySQL and entered:
SHOW COLLATION;
I see utf8mb4_unicode_ci and utf8mb4_unicode_520_ci among the available collations. What is the difference between these two collations and which should we be using?
| Well, you can read about the differences in the documentation. I can't tell you what you should be using because every project is different.
10.1.3 Collation Naming Conventions
MySQL collation names follow these conventions:
A collation name starts with the name of the character set with which
it is associated, follow... | MariaDB | 37,307,146 | 58 |
In MySQL/MariaDB the most efficient way to store uuid is in a BINARY(16) column. However, sometimes you want to obtain it as a formatted uuid string.
Given the following table structure, how would I obtain all uuids in a default formatted way?
CREATE TABLE foo (uuid BINARY(16));
| The following would create the result I was after:
SELECT
LOWER(CONCAT(
SUBSTR(HEX(uuid), 1, 8), '-',
SUBSTR(HEX(uuid), 9, 4), '-',
SUBSTR(HEX(uuid), 13, 4), '-',
SUBSTR(HEX(uuid), 17, 4), '-',
SUBSTR(HEX(uuid), 21)
))
FROM foo;
| MariaDB | 37,168,797 | 56 |
MySQL is awesome! I am currently involved in a major server migration and previously, our small database used to be hosted on the same server as the client. So we used to do this : SELECT * INTO OUTFILE .... LOAD DATA INFILE ....
Now, we moved the database to a different server and SELECT * INTO OUTFILE .... no longer ... | From the manual: The SELECT ... INTO OUTFILE statement is intended primarily to let you very quickly dump a table to a text file on the server machine. If you want to create the resulting file on some client host other than the server host, you cannot use SELECT ... INTO OUTFILE. In that case, you should instead use a ... | MariaDB | 2,867,607 | 50 |
I set up my first Ubuntu Server with Ubuntu 16.04, nginx, php7.0, MariaDB, nextcloud and external DynDNS using this tutorial here: Install Nextcloud 9 on Ubuntu 16.04
Everything worked fine but since I restarted the server the next day, nextcloud just shows me a blank page. After clicking through all logs of nginx, Ma... | In case you are bitten by this bug, the solution is given as a suggestion in the bug report (all of these have to be done as root, so either with sudo -i as a zeroth command or with sudo prefixed):
echo "/usr/sbin/mysqld { }" > /etc/apparmor.d/usr.sbin.mysqld (the second part with sudo is ... | sudo tee /etc/apparmor.... | MariaDB | 40,997,257 | 47 |
I am new to SQL, I was trying to change column name in my database's table. I am using 'xampp' with 'maria DB' (OS - Ubuntu 18.04)
I tried all of the followings:
ALTER TABLE subject RENAME COLUMN course_number TO course_id;
ALTER TABLE subject CHANGE course_number course_id;
ALTER TABLE subject CHANGE 'course_numbe... | Table names, column names, etc, may need quoting with backticks, but not with apostrophes (') or double quotes (").
ALTER TABLE subject
CHANGE COLUMN `course_number` -- old name; notice optional backticks
course_id -- new name
varchar(255); -- must include all the ... | MariaDB | 53,735,305 | 43 |
I am looking for solution on how to update mariadb on xampp 32 bit on window system but not found any article on that.I just found this link. Please help me how to update. I want JSON support that's why I am looking for update from V10.1 to V10.2. Or if there is any other way to do this please let me know
Current versi... | 1 : Shutdown or Quit your XAMPP server from Xampp control panel.
2 : Download the ZIP version of MariaDB
3 : Rename the xampp/mysql folder to mysql_old.
4 : Unzip or Extract the contents of the MariaDB ZIP file into your XAMPP
folder.
5 : Rename the MariaDB folder, called something like mariadb-5.5.37-win32, to
... | MariaDB | 44,027,926 | 41 |
In Hibenate I am using MariaDB but I couldn't find the dialect class name of MariaDB .
In Hibernate, MySQL5 dialect's name is
<property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property>
For Oracle 10g
<property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
What is th... | Update note: Hibernate automatic dialect resolution
In older versions of Hibernate, you are required to specify the dialect. But starting with version 3.2, hibernate uses dialect resolution to automatically determine the target database and the dialect that should be used.
The Hibernate 5.0 userguide says:
In most cas... | MariaDB | 37,066,024 | 39 |
I've been using PDO in PHP for a while now utilizing MySQL.
However, recent developments have made me think that MySQL will start fading out in replacement of MariaDB especially since MariaDB:
Consider themselves many developer years ahead of MySQL without putting new developments into paid areas (clustering for exam... | MariaDB and MySQL are 100% 99% compatible. This includes connector compatibility.
edit: up to the point that MariaDB tools are shipped as MySQL tools (e.g. mysqldump), and data files are binary compatible, too
| MariaDB | 16,195,013 | 38 |
I'm in an environement setup, running OSX with MariaDB 10.0.12-MariaDB Homebrew
I've screwed up the installation so I did completely removed MySQL and MariaDB from my setup and started again.
After finishing installing MariaDB, I've reimported my databases (innoDB) via a DB Dump from the production server. It worked fi... | Something has deleted your ibdata1 file where InnoDB keeps the dictionary. Definitely it's not MySQL who does
| MariaDB | 25,039,927 | 36 |
I have a process that exports the data from an AWS RDS MariaDB using mysqldump which has been running succesfully in a docker-image on Concourse for years.
Since two nights ago the process has started failing with the error:
mysqldump: Couldn't execute 'FLUSH TABLES WITH READ LOCK': Access denied for user 'admin'@'%' (... | Along with granting my user PROCESS priv, I found that the --set-gtid-purged=OFF option worked for me.
mysqldump --single-transaction --set-gtid-purged=OFF -h {host} {schema}
Hitting AWS RDS MySQL 8.0.33 from Ubuntu 22.04
| MariaDB | 75,183,032 | 35 |
After I installed Mariadb 10 the Mysql workbench and JPDB client both connect and work fine so next step was get programming with Python (using SQLAlchemy) which seems to require MySQL-python so I went to update that and got:
"mysql_config not found" I looked in the "usual places" and did not see a file...
So I followe... | For Centos 7.0 install the following:
yum install mariadb-devel
For Fedora 23+:
dnf install mariadb-devel
| MariaDB | 22,949,654 | 32 |
I have a spring-boot application on the same host as the Maria DB and both are running fine for some time. But between 12 hours and 2 days it seems that the spring boot application looses the connection to the database (stacktrace) and does not recover from that.
When I restart the spring application all is fine again... | Per a senior member in the Spring forums, the Spring DataSource is not intended for production use:
The above answers are only part of the solution. Indeed you need
proper transaction managent AND you need a connection pool. The
DriverManagerDataSource is NOT meant for production, it opens and
closes a datebase ... | MariaDB | 28,609,565 | 32 |
I'm attempting to install MariaDB on Ubuntu 12.04 LTS.
I've followed the instructions provided at https://askubuntu.com/questions/64772/how-to-install-mariadb and from MariaDB.org that appear when you choose the download.
The last step is sudo apt-get install mariadb-server which returns:
Reading package lists... Done
... | sudo apt-get install libmysqlclient18=5.5.30-mariadb1~precise mysql-common=5.5.30-mariadb1~precise
sudo apt-get install mariadb-server
The first one reverts the two mysql libs that were bumped ubuntu side to the older mariadb ones. The second one can then proceed normally.
Packages got removed because something like a... | MariaDB | 16,214,517 | 30 |
there are lot of recommendations over the Internet on how to enable SUPER privileges in case if someone hit the following error:
"ERROR 1419 (HY000): You do not have the SUPER Privilege and Binary Logging is Enabled"
But I wasn't be able to find WHY MySQL disables these privileges when binary logging option is on.
A... | Here is some detailed explaination I had found in documentation. Hopefully this could help you to understand.
The CREATE FUNCTION and INSERT statements are written to the
binary log, so the slave will execute them. Because the slave SQL
thread has full privileges, it will execute the dangerous statement.
Thus, the fun... | MariaDB | 56,389,698 | 30 |
I have tried query but there is an error.
Does anybody solved the error?
MariaDB [mysql]> UPDATE user SET Host='%' WHERE User='root';
ERROR 1356 (HY000): View 'mysql.user' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
| MariaDB-10.4+ the mysql.user is a view rather than a table.
Its recommend to stop copying off old blogs to do any authentication relates changes in MySQL and MariaDB, the mechanisms are being updated and no longer apply. Always check the official documentation.
Use SET PASSWORD or ALTER USER to manage user authenticati... | MariaDB | 64,841,185 | 30 |
If I replace a MySQL 5.1 server with a MariaDB Server (Maria & XtraDB storages) instead of MySQL (MyISAM & InnoDB), will most of MySQL client software (incl. applications made with PHP 5.2 and Java SE 1.6) ...
just remain working without any changes (with minor regressions maybe)?
Or will I have to replace/reconfigure... | http://kb.askmonty.org/v/mariadb-versus-mysql
All MySQL connectors (PHP, Perl, Python, Java, MyODBC, Ruby, MySQL C connector etc) works unchanged with MariaDB.
| MariaDB | 4,106,315 | 29 |
Recently, I read a news that MariaDB is a drop-off replacement for MySQL since MySQL has unfriendly pricing for clustered/enterprise version according to Google.
Now I can't find anything relevant about EF for MariaDB on Google so I'm hoping someone knows about it. Is it ok to use MySQL driver for this since it is 100... | I was able to use MariaDB 10 with Entity Framework although it required a bit of work mainly because the MySQL tools are a bit buggy.
To work with MySQL/MariaDB in Visual Studio 2010/2012,you need to install MySQL for Visual Studio using MySQL Installer. I used the Web version as I only wanted to download the connector... | MariaDB | 20,183,781 | 28 |
I've installed mariadb from Ubuntu 15.04 repositories using the Ubuntu software center or at the command prompt (apt-get install maraidb-server), but no password is asked for root user.
Now I'm able to connect to mysql on command line without password, but connecting using Mysql-Workbench or python mysqldb library fail... | Starting with MariaDB 10.4 root@localhost account is created with the ability to use two authentication plugins:
First, it is configured to try to use the unix_socket authentication plugin. This allows the root@localhost user to login without a password via the local Unix socket file defined by the socket system vari... | MariaDB | 30,815,971 | 28 |
I've created a small docker-compose.yml which used to work like a charm to deploy small WordPress instances. It looks like this:
wordpress:
image: wordpress:latest
links:
- mysql
ports:
- "1234:80"
environment:
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_NAME: wordpress
WORDPRESS_DB_PASSWORD: "p... | To fix this issue the first thing to do is:
Add the following code to wordpress & database containers (in the docker-compose file):
restart: unless-stopped
This will make sure you Database is started and intialized before wordpress container trying to connect to it. Then restart docker engine
sudo restart docker
or (... | MariaDB | 34,068,671 | 28 |
I'm getting this error:
SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\xBD Inch...' for column 'column-name' at row 1
My database, table, and column have the format utf8mb4_unicode_ci also column-name is type text and NULL.
This is the value of the column-name
[column-name] => Some text bef... | I solved it, encoding to uft-8 all string columns that generated this error before insert. For example, the column that generated the error was column-name, I encoded as show bellow. Also I found other column with the same error, I used this solution, too.
$data [
//key=>values
];
$myModel = new MyModel();
$data['c... | MariaDB | 48,270,374 | 27 |
I was asked to check Mariadb as Centos does not provider MySQL 5.5 for the moment. I have read that xtradb servers as a drop in for innodb.
What are the advantages of using one or the other because if they were equal, they would not have been called the same name?
Do you think that I should switch to Mariadb? What kin... | XtraDB is InnoDB with several patches added. The patches themselves stem from Google, Facebook and others. XtraDB is maintained by Percona and the heart of Percona Server.
You may think of Percona as a distributor who collects, coordinates and maintains patches and distributes an enhanced version of the MySQL server.
A... | MariaDB | 12,037,363 | 26 |
I get the error from this line
SELECT table.field
FROM table
WHERE table.month = 'october'
AND DATEDIFF(day, table.start_date, table.end_date) < 30
The dates in my column are in the format m-d-yy
Do I need to convert this to a different format? If so how?
Using MariaDB
| According to the documentation for MariaDB DATEDIFF only takes two arguments:
Syntax
DATEDIFF(expr1,expr2)
Description
DATEDIFF() returns (expr1 – expr2)
expressed as a value in days from one date to the other. expr1 and
expr2 are date or date-and-time expressions. Only the date parts of
the values are used in t... | MariaDB | 23,250,555 | 25 |
I'm using last version of laravel (5.1) in a homestead virtual machine (vagrant).
I connect my project to a local mariaDB server, in which I have some table and 2 db-view.
Since I made some select only on the db-view tables, I receive back randomly this error:
General error: 1615 Prepared statement needs to be re-prep... | It seems to work adding
'options' => [
\PDO::ATTR_EMULATE_PREPARES => true
]
Inside projectName/config/database.php file in DB configuration. It will be like this:
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE'... | MariaDB | 31,957,441 | 25 |
I've just updated MariaDB using apt-get dist-upgrade. Now it won't start using service mysql start anymore.
I can however, run it as root or do: sudo -u mysql mysqld_safe then MariaDB starts up fine. The folder /home/mysql is owned by the mysql user and group.
I've found the error to be thrown in this function:
https:/... | To run MariaDB SQL from /home, in the file /usr/lib/systemd/system/mariadb.service or /lib/systemd/system/mariadb.service, just change :
ProtectHome=true
to :
ProtectHome=false
| MariaDB | 38,529,205 | 24 |
I have an issue with the official dockerized image of Mariadb.
When my applications tries to make some queries I got the following error :
DB Error: unknown error QUERY : INSERT INTO
It seems this error comes from the SQL_MODE, which is set as follow in this image :
STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_A... | In your docker-compose.yml set command: --sql_mode="".
Here is an example:
db-service:
build:
context: .
dockerfile: db.dockerfile
image: example/repo:db
ports:
- "3306:3306"
volumes:
- ./data/db-data:/var/lib/mysql
- ./data/db-init:/docker-entrypoint-initdb.d/
ports:
... | MariaDB | 48,924,667 | 24 |
My main question is that after I have created a docker container for my mariadb with the command docker run --name db -e MYSQL_ROOT_PASSWORD=test -d -p 3306:3306 mariadb how can I access the sql db?
Somewhere I have seen a solution using a temporal (after exit the container is deleted) container, but cannot find it any... | First access the container terminal
docker exec -it some-mariadb bash
'some-mariadb' is the mysql container name
Then access the db directly using the mysql terminal command
mysql -u root -p
| MariaDB | 33,170,489 | 23 |
In Debian Jessie I installed MariaDB server 10.0.30 and I try to increase max key length. AFAIU it depends of the config parameter innodb_large_prefix being enabled. According to the docs, it also requires barracuda file format and innodb_file_per_table. After setting them in config and restarting server I see in clien... | It requires more than just those two settings...
SET GLOBAL innodb_file_format=Barracuda;
SET GLOBAL innodb_file_per_table=ON;
SET GLOBAL innodb_large_prefix=1;
logout & login (to get the global values);
ALTER TABLE tbl ROW_FORMAT=DYNAMIC; -- or COMPRESSED
Perhaps all you need is to add ROW_FORMAT=... to your CREATE ... | MariaDB | 43,379,717 | 23 |
Im using xampp control panel and from there i start the process for apache and mysql. Then i go to mysql workbench and server status seems to be ok, here is some info
Host: Windows-PC
Socket: C:/xampp/mysql/mysql.sock
Port: 3306
Version 10.1.31-MariaDB mariadb.org binary distribution
Compiled For: Win32(32)
Configurati... | Problem is the word VISIBLE, remove it and it will work.
Index are visible by default.
Your question: "If i remove VISIBLE it works just fine, so why did mysql workbench decided to add visible?"
My answer: The option to mark index invisible is not yet implemented in MariaDB (afaik!).
Update:
The syntax for MariaDB is ... | MariaDB | 50,393,245 | 23 |
I am new to Docker, I was trying to crate docker container of mariadb for my application but when I start running mariadb container it shows Access denied for user 'root'@'localhost' (using password: YES) dockerfile
Following is the docker compose I am using.
version: '3'
services:
mysql:
image: mariadb
con... | It will affect the new user and keys even if you create fresh container.
Remove mount location, as it will pick a user name and password from this location, also will not run your DB init script too.
volumes:
- dbvolume:/var/lib/mysql
Also you do not need
create database appdata;
As database already creat... | MariaDB | 58,085,851 | 23 |
I just read online that MariaDB (which SQLZoo uses), is based on MySQL. So I thought that I can use ROW_NUMBER() function
However, when I try this function in SQLZoo :
SELECT * FROM (
SELECT * FROM route
) TEST7
WHERE ROW_NUMBER() < 10
then I get this error :
Error: FUNCTION gisq.ROW_NUMBER does not exist
| You can use the limit clause:
SELECT * FROM route LIMIT 10
This can, of course, be used on a sorted query too:
SELECT * FROM route ORDER BY some_field LIMIT 10
| MariaDB | 27,133,374 | 22 |
How can I use MariaDB instead of MySQL in my Rails project?
When I try to install mysql2 gem it returns error,because mysqlclient was not found.
Here some solution, but I didn't found any libmariadbd-dev package on my openSUSE 12.3.
| It doesn't look like openSUSE has a MariaDB client development package. You must install the libmysqlclient-devel package package. Since MariaDB is tagged as a drop in replacement for MySQL, it would have to support the MySQL clients, though you may lose tiny bits of MariaDB improvements.
It appears that the mysql2 ... | MariaDB | 16,304,311 | 21 |
I have sql like this:
UPDATE "user_login a"
LEFT OUTER JOIN "p_pegawai b"
ON a.id_pegawai = b.id
SET a.password = 'Keluarga1'
WHERE b.NIP = '195812'
I have tried this :
MySql Update A Joined Table
but it always give me error
You have an error in your SQL syntax; check the manual that correspon... | Use backticks in MySQL but do not apply these to the combined table and alias they must be treated as separate items
UPDATE `user_login` a
LEFT OUTER JOIN `p_pegawai` b
ON a.id_pegawai = b.id
SET a.password = 'Keluarga1'
WHERE b.NIP = '195812'
| MariaDB | 47,546,152 | 21 |
In my understanding, mysql binlog can fully function as InnoDB's redo log.
So, after the binlog is enabled, why does InnoDB have to write a redo log at the same time instead of just switching to use the binlog? Doesn't this significantly slow down database write performance?
In addition to simplifying design and imple... | This is an interesting topic. For a long time, I have been advocating the idea of merging the InnoDB write-ahead log and the binlog. The biggest motivation for that would be that the need to synchronize two separate logs would go away. But, I am afraid that this might not happen any time soon.
At MariaDB, we are taking... | MariaDB | 57,983,490 | 21 |
What is the default port number of MariaDB?
I am new to programming. I am creating my first Java application that connects to MariaDB. I need to specify the database port number.
| The default port number of MariaDB is 3306. It is the same as MySQL.
| MariaDB | 59,113,646 | 21 |
I have been trying to run pip3 install mariadb on my raspberry pi running ubuntu 18.04 and I was unsuccessful.
I have tried installing following packages as suggested in other answers:
sudo apt-get install mariadb-server
sudo apt-get install libmariadbclient-dev
sudo apt-get install libmysqlclient-dev
pip3 install mys... | You probably need to install MariaDB database development files: https://packages.debian.org/unstable/libmariadb-dev. You need this package for your python connector to work properly in linux. You need to follow these steps:
sudo apt-get update -y
sudo apt-get install -y libmariadb-dev
pip3 install mariadb
Here you a... | MariaDB | 63,027,020 | 21 |
I understand that collations are a set of rules for making comparisons over a character set. MySQL / MariaDB has table and database collations in addition to column collation. I was wondering what was the difference between a collation on these three (database, table and column).
Thanks.
| MySQL's character sets and collations can be interpreted as a top-down list of prioritized items. The topmost is least priority and the bottommost is most priority.
Order of precedence with topmost being least precedence:
Server collation
Connection-specific collation
Database collation
Table collation
Column collatio... | MariaDB | 24,356,090 | 20 |
Background: I downloaded a *.sql backup of my WordPress site's database, and replaced all instances of the old database table prefix with a new one (e.g. from the default wp_ to something like asdfghjkl_).
I've just learnt that WordPress uses serialized PHP strings in the database, and what I did will have messed with ... | Visit this page: http://unserialize.onlinephpfunctions.com/
On that page you should see this sample serialized string: a:1:{s:4:"Test";s:17:"unserialize here!";}. Take a piece of it-- s:4:"Test";. That means "string", 4 characters, then the actual string. I am pretty sure that what you did caused the numeric character ... | MariaDB | 15,138,893 | 19 |
I am trying to connect to a database in Mariadb through a simple java application but the connection is told to be unsuccessful and an Exception is thrown. I have done the similar connection using mysql and it was working correctly. The problem is maybe with the driver here.
try{
Class.forName("org.mariadb.j... | It appears that you are trying to use jdbc:mariadb://... to establish a connection to a MariaDB server instance using the MySQL JDBC Driver. That probably won't work because the MySQL JDBC Driver would use jdbc:mysql://..., regardless of whether it is connecting to a MySQL server or a MariaDB server. That is, the conne... | MariaDB | 23,020,857 | 19 |
I used the following query with MySQL 5.5 (or previous versions) for years without any problems:
SELECT t2.Code from (select Country.Code from Country order by Country.Code desc ) AS t2;
The order of the result was always descending as I needed.
Last week, I just migrated to a new MySQL Version (In fact, I migrated to... | After a bit of digging, I can confirm both your scenarios:
MySQL 5.1 does apply the ORDER BY inside the subquery.
MariaDB 5.5.39 on Linux does not apply the ORDER BY inside the subquery when no LIMIT is supplied. It does however correctly apply the order when a corresponding LIMIT is given:
SELECT t2.Code
FROM (
SEL... | MariaDB | 26,372,511 | 19 |
how to apply WHERE clause on JSON column to perform a SELECT query on a table which is having two columns (id Integer, attr JSON). The JSON is nested and in the filter condition there is only one key value pair of json is allowed. This key value pair can be anywhere in the Josn.
+----+----------------------------------... | In MariaDB 10.2, you can use the JSON functions.
For example, if you want to SELECT all donuts from your database, you do:
SELECT * FROM t WHERE JSON_CONTAINS(attr, '"donut"', '$.type');
Note: In MariaDB, JSON functions work with all text data types (VARCHAR, TEXT etc.). The JSON type is simply an alias for LONGTEXT.
| MariaDB | 48,804,649 | 19 |
I have a Drupal multisite that needs to have one database for each site, and want it to run in ddev, but ddev just has the one database by default, named 'db'. How can I get a second database?
| You can import additional databases directly with ddev import-db --database=newdb --file=/path/to/file.sql.gz. The created database will already have permissions, etc.
You can also manually create and manage databases (although this is rarely necessary). The root password for the db server is 'root', so you can mysql -... | MariaDB | 49,785,023 | 19 |
I have read somewhere that, there is no driver for "MariaDB" in Laravel 5 and that we can use mysql driver to use MariaDB in Laravel 5. But even then I am getting this error when i give my MariaDB username and password. The password is "root" and username is also "root".
SQLSTATE[HY000] [1045] Access denied for user 'r... | 'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '3307'),
'database' => env('DB_DATABASE', 'doctorsondemand'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', 'root'),
'cha... | MariaDB | 31,650,972 | 18 |
mariaDB is not starting in my windows 10.
I am getting the following in the logs:
Cannot find checkpoint record at LSN (1,0x5c8f)
2019-12-19 9:18:13 0 [ERROR] mysqld.exe: Aria recovery failed. Please run aria_chk -r on all Aria tables and delete all aria_log.######## files
2019-12-19 9:18:13 0 [ERROR] Plugin 'Aria' ... | With the help of @RiggsFolly, the following solved my issue.
Open cmd.
In cmd, go to xampp/mysql/data folder.
In my case, I did the following cd C:\xampp\mysql\data
Run aria_chk -r in that directory for all .MAI tables in the mysql subfolder.
In my case, ..\bin\aria_chk -r mysql\*.MAI
Delete all aria_log.#######... | MariaDB | 59,410,692 | 18 |
Just installed MariaDB (with homebrew). Everything looks like it's working, but I can't figure out how to have it automatically startup on boot on my Mac. I can't find any Mac-specific docs for this.
The installation output says:
To start mysqld at boot time you have to copy
support-files/mysql.server to the right pl... | From brew info mariadb
To have launchd start mariadb now and restart at login:
brew services start mariadb
Or, if you don't want/need a background service you can just run:
mysql.server start
Just run brew services start mariadb on terminal.
| MariaDB | 17,461,170 | 17 |
After replacing mysql with mariadb, I encountered the following error:
PHP Fatal error: Uncaught exception 'PDOException' with message
'could not find driver' in /var/www/inlcude/config.php:5\nStack
trace:\n#0 /var/www/inlcude/config.php(5):
PDO->__construct('mysql:dbname=my...', 'apache', 'ABCDE...')\n#1
/va... | By trial and error, it turns out that I need to install mysqlnd to get the PDO driver.
yum install php-mysqlnd
Don't ask me why or how it works because I have absolutely no idea.
| MariaDB | 20,898,711 | 17 |
I've used:
Connection connection = DriverManager.getConnection(
"jdbc:mysql://localhost:3306/test", "username", "password"
);
Statement stmt = connection.createStatement();
stmt.executeUpdate("CREATE TABLE a (id int not null primary key, value varchar(20))");
stmt.close();
connection.close();
but it gives an erro... | Java MariaDB example:
//STEP 1. Import required packages
package mariadb;
import java.sql.*;
public class Mariadb {
// JDBC driver name and database URL
static final String JDBC_DRIVER = "org.mariadb.jdbc.Driver";
static final String DB_URL = "jdbc:mariadb://192.168.100.174/db";
// Database credent... | MariaDB | 37,909,487 | 17 |
How can I switch the database from MySQL to MariaDB in WAMP 3.1.0?
I'm looking for it, but I can not find it.
| From the image you show it looks like both MySQL and MariaDB are already running!
NOTE: Thats a bit memory hungry!
Simple test to see if both MySQL and MariaDB are running. Launch phpMyAdmin and look at the login screen. If both are running you should see a Server Choise dropdown under the Username and Password fields.... | MariaDB | 47,813,733 | 17 |
I've done quite a bit of reading before asking this, so let me preface by saying I am not running out of connections, or memory, or cpu, and from what I can tell, I am not running out of file descriptors either.
Here's what PHP throws at me when MySQL is under heavy load:
Can't connect to local MySQL server through so... | Most likely it is due to net.core.somaxconn
What is the value of /proc/sys/net/core/somaxconn
net.core.somaxconn
# The maximum number of "backlogged sockets". Default is 128.
Connections in the queue which are not yet connected. Any thing above that queue will be rejected. I suspect this in your case. Try increasin... | MariaDB | 28,828,141 | 16 |
I'm using the DBeaver to handle with databases.
|/MariaDB-mysql
|-- /information_schema
|-- /mysql
|-- /performance_schema
|-- /autoparanaiba
I want to run some .sql file inside the autoparanaiba but I didn't find the IMPORT.
| Right Click on autoparanaiba --> Tools -- > Restore Database
| MariaDB | 61,685,353 | 16 |
When we try to GRANT ALL permissions to a user for a specific database, the admin (superuser) user of database receives the following error.
Access denied for user 'admin'@'%' to database 'the_Db'
After looking other questions in stackoverflow I could not find the solution. I already tried to change * -> % without suc... | Try this
mysql -h your-rds-host-name -P 3306 -u rds-master-user -p
CREATE DATABASE sitedb;
CREATE USER 'siteuser'@'%' IDENTIFIED BY 'Password';
// For MySQL 5.7 or Less
GRANT ALL ON sitedb.* TO 'siteuser'@'%' IDENTIFIED BY 'Password' WITH GRANT OPTION;
// MariaDB 10 Up
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ... | MariaDB | 64,974,214 | 16 |
I'm trying to connect to a MariaDB database in a C script and I can't find the necessary documentation. I installed libmariadbclient-dev, but I couldn't find any accompanying documentation such as a man page. There's a basic description and limited documentation here, but the documentation only includes descriptions of... |
The MariaDB Client Library for C has exactly the same API as the MySQL
Connector/C for MySQL 5.5
Here it is: http://dev.mysql.com/doc/refman/5.5/en/c-api-function-overview.html
Another one:
http://zetcode.com/db/mysqlc/
You can compile a minimal test like
#include <my_global.h>
#include <mysql.h>
int main(int argc... | MariaDB | 17,265,471 | 15 |
I have a MariaDB Galera Cluster(3 nodes), I set uid to increase automatically and be the primary key of the table as
`uid | int(11) | NO | PRI | NULL | auto_increment`.
MariaDB [hello_cluster]> select uid from table order by uid limit 10;
+-----+
| uid |
+-----+
| 3 |
| 6 |
... | This is by design and is reported in MariaDB Galera Cluster - Known Limitations:
Do not rely on auto-increment values to be sequential. Galera uses a mechanism based on autoincrement increment to produce unique non-conflicting sequences, so on every single node the sequence will have gaps.
The rational is explained i... | MariaDB | 23,022,574 | 15 |
What is the reason that the following two queries give wildly different results?
MariaDB [mydatabase]> SELECT COUNT(DISTINCT(`price`)) FROM `products`; --Good
+--------------------------+
| COUNT(DISTINCT(`price`)) |
+--------------------------+
| 2059 |
+--------------------------+
1 row in set (0.... | 'price' (apostrophes or quotes) is a string. It never changes, so the count is always 1.
`price` (backtics) refers to the column price. So it could be more than 1.
The inner parentheses are irrelevant. COUNT(DISTINCT price) is the same as your backtic version.
SELECT COUNT(*) FROM tbl WHERE ... is a common way to a... | MariaDB | 29,402,361 | 15 |
I'm trying to execute a raw query that is built dynamically.
To assure that the parameters are inserted in the valid position I'm using named parameters.
This seems to work for Sqlite without any problems. (all my tests succeed)
But when I'm running the same code against MariaDB it fails...
A simple example query:
SEL... | edit:
The format needs to have s suffix as following:
%(u_email)s
| MariaDB | 36,311,528 | 15 |
So I basically am installing mariadb with mysql on my mac using homebrew.
These are the steps I made:
brew doctor -> worked
brew update -> worked
brew install mariadb -> worked
mysql_install_db -> Failed
WARNING: The host 'Toms-MacBook-Pro.local' could not be looked up
with /usr/local/Cellar/mariadb/10.4.6_1/bin... | You could try to update the root password and access it afterwards
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';
Exit Mysql and try to login
mysql -uroot -p # then use root as a password
| MariaDB | 57,803,604 | 15 |
Besides having mariadb 10.1.36-MariaDB I get following error.
EXPLAIN ANALYZE select 1
MySQL said: Documentation
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 'ANALYZE select 1' at line 1
What additional I need to do here... | As you can see in the docs https://mariadb.com/kb/en/explain-analyze/
The syntax for the EXPLAIN ANALYZE feature was changed to ANALYZE statement, available since MariaDB 10.1.0. See ANALYZE statement.
So just use ANALYZE ... without the explain keyword and you'll get the same output you got in the past.
In the anal... | MariaDB | 60,797,825 | 15 |
Have a simple question here.
I've a database with around 1 billion records, a server with 200GB of ram to handle it.
What do you suggest for best performances? Mysql 5, Mysql 6 or MariaDB?
| MariaDB 5.3 should give you the best performance:
It uses the XtraDB (InnoDB improved) storage engine from Percona as
default.
The optimizer is greatly improved to handle big data.
Replication is a magnitude faster in MariaDB if you have lots of
concurrent updates to InnoDB.
See http://kb.askmonty.org/en/what-is-mari... | MariaDB | 7,547,121 | 14 |
I get this annoying error when I try to insert data from db1 to db2 in MaridaDB 10 using mysql CLI. This is while all the columns exist.
INSERT INTO db2.thread (threadid, title, postuserid, dateline, views)
SELECT `nid`, `title`, `uid`, `created`,
`comment` from db1.node where type = 'forum' and status = 1;
Whe... | Looks like there are invisible garbage characters in your query.
Try retyping the query (don't copy and paste or you'll most likely include the garbage character) and it should work.
| MariaDB | 16,910,652 | 14 |
I'm creating a table like this,
Schema::create('booking_segments', function (Blueprint $table) {
$table->increments('id');
$table->datetime('start')->index();
$table->integer('duration')->unsigned();
$table->string('comments');
$table->integer('booking_id')->unsigned();
$table->foreign('booking... | I know this is an old question, but there is a way to do it using the schema builder since Laravel 5.3, so I thought I would put it here for completeness.
You can use laravel 5.3 column modifiers virtualAs or storedAs.
So, to create a virtual generated column to be computed at every query you would create the column li... | MariaDB | 27,749,887 | 14 |
I am using node.js, Sequelize and MariaDB and I am running into the following error, which I am not sure how to resolve?
Error: Naming collision between attribute 'playlist' and association
'playlist' on model playlist_entry. To remedy this, change either foreignKey
or as in your association definition
My Javascr... | I faced exactly this problem while play with Sequelize, It's happened because the column name and reference name are same
Wrong Implementation
module.exports = (sequelize, DataTypes) => {
const session = sequelize.define('session', {
menteeId: DataTypes.INTEGER,
}, {});
session.associate = (models) => {
... | MariaDB | 37,121,882 | 14 |
I'm trying to get work MariaDB Galera 10.1 under debian 8 jessie.
I've installed all neccesary components and did configurations but i cannot get it work.
The nodes are builded as VPS.
Configuration of node 1:
[mysqld]
# Cluster node configurations
wsrep_cluster_address="gcomm://172.16.0.102,172.16.0.112"
wsrep_node_... | Since MariaDB 10.1.8, systemd is the new init and it affects the way Galera is bootstrapped on RPM and Debian based Linux distributions (in my case Ubuntu 16.04). On previous versions, you would use something like service mysql start --wsrep-new-cluster or service mysqld bootstrap but that doesn't work any more as it f... | MariaDB | 37,212,127 | 14 |
How can i tell if a server I'm connecting to is Percona or MySQL or MariaDB?
Is there any standard way of doing this?
I'm currently using SHOW VERSION to test the server version, but I would also need to display the server name in the app I'm working on.
| You can get specific information with:
SHOW VARIABLES LIKE '%vers%'
version and version_comment are very specific.
| MariaDB | 37,317,869 | 14 |
I have Ubuntu 16.04, and Mysql 5.7.12-0ubuntu1.1. When I type:
sudo mysql -u root
I can login into mysql console, but when I type it without sudo:
mysql -u root
I obtain error:
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
My problem occurred when I installed and removed MariaDB. I remember that in ... | This problem seems to be primarily caused by the auth_socket plugin which is now used by default if the root user doesn't have a password. (Formerly, the apt-get install process asked for a password for root, but it doesn't seem to do that anymore so auth_socket gets enabled.)
For either query, first login as root by ... | MariaDB | 38,098,505 | 14 |
I've a root User on the MariaDB on Ubuntu 16.04.
As default the root user is authenticated by the unix_socket authentication plugin.
I can switch the authentication method to password method by setting
update mysql.user set plugin='' where user='root';
This works fine. But ...
Is there a possibility to authenticate ... | A reliable and straightforward way would be to create another super-user and use it when you want to connect by password.
CREATE USER admin@localhost IDENTIFIED BY 'password';
GRANT ALL ON *.* TO admin@localhost WITH GRANT OPTION;
-- etc
| MariaDB | 41,846,000 | 14 |
There is something that bothers me. I've tried to find one clear answer but no luck so far.
I'm using Symfony3 and Doctrine2 and MariaDB.
Let's assume that I've created something like this in my entity:
/**
* @ORM\Column(
* name="status",
* type="boolean",
* options={"default": 0}
* )
*/
private $sta... | Like @Cerad commented, you just need to initialize the property in your actual entity class
/**
* @ORM\Column(
* name="status",
* type="boolean",
* options={"default": 0}
* )
*/
private $status = 0;
| MariaDB | 43,195,874 | 14 |
We currently use MySQL 5.7 and store passwords via the mysql-config-editor.
It stores the login-path in an encrypted file, .mylogin.cnf.
MariaDB does not support this functionality (and considers it a bad idea).
So what is the MariaDB way of doing this?
PostgreSQL offers ~/.pgpass for this purpose.
| You can use an unencrypted options file. Create a new options file in your home directory, readable only by you, like this:
[client]
host='<your-db-host>'
port='<your-db-port>'
socket='<your-db-socket>'
database='<your-db-name>'
user='<your-db-user>'
password='<your-db-password>'
You can then use with a --defaults-ext... | MariaDB | 49,109,592 | 14 |
This is my model:
class Subscriber(models.Model):
...
tenant = models.ForeignKey(Tenant, on_delete=models.CASCADE, null=True)
...
This is the generated SQL, according to sqlmigrate (and to manual inspection of the database):
ALTER TABLE `myapp_subscriber` ADD CONSTRAINT `myapp_subscriber_tenant_id_b52815ee... | From the docs:
on_delete doesn’t create a SQL constraint in the database. Support for
database-level cascade options may be implemented later
It will perform the cascade in Django itself, so if you delete a Tenant object using Django delete() your Subscriber object will also be deleted. But not if you do it in SQL.... | MariaDB | 54,751,466 | 14 |
I am building an Alpine based image of a Django application with MariaDB and I can't figure out which dependency I should add to my Dockerfile so that my app could properly connect to the DB.
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.
Did you install mysqlclient?
Well, I thought I did.... | It seems you're missing the MySQLdb Python module, for which you should install the mysqlclient Python package: pip install mysqlclient.
On Alpine, pip will build mysqlclient from source, so you'll need gcc and musl-dev for this setup step, hence you'll need to postpone apk del build-deps to after Python modules are in... | MariaDB | 56,048,631 | 14 |
Problem
Suppose I have this table tab (fiddle available).
| g | a | b | v |
---------------------
| 1 | 3 | 5 | foo |
| 1 | 4 | 7 | bar |
| 1 | 2 | 9 | baz |
| 2 | 1 | 1 | dog |
| 2 | 5 | 2 | cat |
| 2 | 5 | 3 | horse |
| 2 | 3 | 8 | pig |
I'm grouping rows by g, and for each group I want one value fro... | This way doesn't use sub-query.
SELECT t1.g, t1.v
FROM tab t1
LEFT JOIN tab t2 ON t1.g = t2.g AND (t1.a < t2.a OR (t1.a = t2.a AND t1.b < t2.b))
WHERE t2.g IS NULL
Explanation:
The LEFT JOIN works on the basis that when t1.a is at its maximum value, there is no s2.a with a greater value and the s2 rows values will be ... | MariaDB | 12,726,549 | 13 |
I am totally new to databases. I would like to create a database; I am going to make a small project which is going to use DB. I am going to use Maria DB as it is totally free for commercial use.
The question is: Can I use MySQL workbench program to create a database and then transform/change it to MariaDB?
| From my experience -- Sure, you can use MySQL Workbench with MariaDB.
However, I have tried basic functionalities only, like queries, schema design etc. Not sure about compatibility of advanced features.
| MariaDB | 22,616,861 | 13 |
I want to build and execute a query like this with jOOQ.
SELECT EXISTS( subquery )
For exemple:
SELECT EXISTS(SELECT 1 FROM icona_etiqueta WHERE pvp IS NULL AND unitat_venda = 'GRAMS')
How can I do it? Can it be done?
| Found it. I was looking for a selectExists method and got confused by the DSL.exists() predicate constructor.
There is a much more convenient fetchExists(subquery).
My specific example is resolved like this:
create.fetchExists(
create.selectOne()
.from(ICONA_ETIQUETA)
.where(ICONA_ET... | MariaDB | 42,221,544 | 13 |
CREATE TABLE `files` (
`did` int(10) unsigned NOT NULL DEFAULT '0',
`filename` varbinary(200) NOT NULL,
`ext` varbinary(5) DEFAULT NULL,
`fsize` double DEFAULT NULL,
`filetime` datetime DEFAULT NULL,
PRIMARY KEY (`did`,`filename`),
KEY `fe` (`filetime`,`ext`), -- This?
KEY `ef` (`ext`,`filetime... | First, let's try FORCE INDEX to pick either ef or fe. The timings are too short to get a clear picture of which is faster, but `EXPLAIN shows a difference:
Forcing the range on filetime first. (Note: The order in WHERE has no impact.)
mysql> EXPLAIN SELECT COUNT(*), AVG(fsize)
FROM files FORCE INDEX(fe)
WHERE... | MariaDB | 50,239,658 | 13 |
I just installed MariaDB 10.1.29 on Ubuntu 18.04. From the command line I can connect using sudo:
sudo mysql -u root -p
But not without sudo.
Also, if I try to connect to the database through DBeaver, I get:
Could not connect: Access denied for user 'root'@'localhost'
While the credentials are correct. I tried instal... | As it turns out, this is expected behaviour for MariaDB and MySQL. To overcome the issue, it is advisable to create a separate user and grant access to all databases created. Here is a step by step guide on how to create databases using the command line and grant permissions to the user of your choice.
Log in to MariaD... | MariaDB | 50,453,078 | 13 |
So I have read a few posts on here but I cant seem to get this working on MySQL.
Pretty much I have a «count» of records with an itemid that I want to update into my items table based on the itemid into items.
This is what I have tried:
Update items
SET items.popularity = countitems.countofscriptiD
FROM items
INNER JOI... | The right way to do that, doing the join of tables before SET:
UPDATE items
INNER JOIN
(SELECT Count(scripts.ScriptID) AS CountOfScriptID, scripts.ItemID
FROM scripts GROUP BY scripts.ItemID) as countitems
ON
items.itemid = countitems.itemid
SET items.popularity = countitems.countofscriptiD
See https://dev.mysql.com/... | MariaDB | 51,977,955 | 13 |
I have just installed MariaDB via homebrew on my Mac. At the end of the installation I got the following error:
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall mariadb`
If I run brew postinstall mariadb I get:
==> /usr/local/Cellar/mariadb/5.5.34/bin/mysql_install... | Just open the config file at /usr/local/etc/my.cnf with your editor and comment out the following line:
!includedir /usr/local/etc/my.cnf.d
| MariaDB | 20,448,822 | 12 |
I have this column in this database with a spacebar included, which I want to change.
ALTER TABLE . CHANGE COLUMN `Anzahl Personen` AnzahlPersonen int(11);
After using this line in the command line the output is as following:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds ... | If you are using dot (.) instead of table name that is why you have error.
You have to specify table name:
ALTER TABLE `table_name` CHANGE COLUMN `Anzahl Personen` AnzahlPersonen int(11);
| MariaDB | 28,507,987 | 12 |
I want to write simple python application and put in docker conteiner with dockerfile. My dockerfile is:
FROM ubuntu:saucy
# Install required packages
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install python
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-server python-mysqldb
# Add... | The problem is that you've never started the database - you need to explicitly start services in most Docker images. But if you want to run two processes in Docker (the DB and your python program), things get a little more complex. You either have to use a process manager like supervisor, or be a bit cleverer in your s... | MariaDB | 29,420,870 | 12 |
We are trying to upgrade to lastest sonarqube 5.5. We have mariadb 10.1 (latest) and since now we had no problems with sonarqube.
Now, with the upgrade, sonarqube will not boot. It says:
Unsupported mysql version: 5.5. Minimal supported version is 5.6.
Is there any trick we can use to make "sonar think" we are using my... | You could change the MINIMAL_SUPPORTED_DB_VERSIONS member in the Sonarqube's class https://github.com/SonarSource/sonarqube/blob/master/sonar-db/src/main/java/org/sonar/db/DatabaseChecker.java
private static final Map<String, Version> MINIMAL_SUPPORTED_DB_VERSIONS = ImmutableMap.of(
// MsSQL 2008 is 10.x
// M... | MariaDB | 37,026,631 | 12 |
I'm trying to connect to an old MySQL 3.23 server from an Ubuntu 16 client with UnixODBC and pyodbc 3.07. I've tried three (3) versions of MySQL Connector/ODBC and two (2) from MariaDB:
MySQL-ODBC 5.3.9 Supports only the new mysql authentication method. Therefore it can not connect.
MySQL-ODBC 5.1.13 Has a switch for t... | I spent a day or so poking at this, and don't think it's possible without significant alterations to driver code, or an extremely difficult-to-create build environment for old versions.
I am putting this in an answer so that other people don't fall down the same rabbit hole I did (or, better yet, so other people can pi... | MariaDB | 47,350,382 | 12 |
I have developed a website using PhalconPHP. the website works perfectly fine on my local computer with the following specifications:
PHP Version 7.0.22
Apache/2.4.18
PhalconPHP 3.3.1
and also on my previous Server (with DirectAdmin):
PHP Version 5.6.26
Apache 2
PhalconPHP 3.0.1
But recently I have migrated to a new ... | MariaDB was built to be mostly compatible with MySQL clients, it's unlikely to be the reason for your problems. If you're still concerned, you can switch from MariaDB to MySQL (and vice versa) by dumping (exporting) your tables, switching over, and importing them again.
More likely, the error line you're showing indica... | MariaDB | 49,319,731 | 12 |
I'm trying to wirte a little log procedure for my database. I create a procedure with this statment:
create procedure prc_wirte_log (
in p_schema varchar(255),
in p_item varchar(255),
in p_message varchar(255)
)
begin
insert into weather.log (`schema`, item, message) values (p_schema, p_item, p_message... | Multistatement procedures (assumed when BEGIN...END is present) require delimiter overrides to prevent the statements they contain from terminating the procedure definition prematurely.
Typically, you need to do something like:
DELIMITER //
CREATE PROCEDURE blah()
BEGIN
statements;
END//
DELIMITER ;
The first exa... | MariaDB | 52,412,225 | 12 |
I installed mariadb via homebrew to set up a wordpress enviroment. It is meant to work with laravel valet. I am currently using using the zsh shell.
I installed it without a problem (10.3.12), but when I run mysql.server start I get the following error:
mysql.server start
Starting MariaDB
.190206 11:26:18 mysqld_safe ... | Brew has its own service manager included. Via brew services list you get all installed services listed. MariaDB should be there.
To start it call brew services start mariadb.
| MariaDB | 54,560,307 | 12 |
Trying to enable regular password-based auth according to the below page:
https://mariadb.com/kb/en/library/authentication-plugin-unix-socket/
The page suggests the following code:
ALTER USER root@localhost IDENTIFIED VIA mysql_native_password;
SET PASSWORD = PASSWORD('foo');
but on my machine it fails with a syntax e... | If you're running MariaDB < 10.2, the ALTER USER command will not work, as stated above.
To change the authentication method, use:
UPDATE mysql.user SET plugin = 'mysql_native_password' WHERE user = 'root';
| MariaDB | 56,052,177 | 12 |
I'm currently working on a closed-source commercial web-project which uses MariaDB as the database. I wonder about the licensing of MariaDB. Do we have to get a license to use it with our commercial project? On the website, they mention the "GNU General Public License, version 2". What exactly does that mean?
http://kb... | The GPL (GNU General Public License) states that you can use the software free of charge, but you cannot modify and sell it unless you release the source code. This means you can use it in your closed-source project.
MySQL was originally under the GPL, but has some different licensing issues since it was bought up by O... | MariaDB | 3,978,963 | 11 |
I am trying to use official mariadb docker image along with the php-fpm and nginx to run my Symfony 2 app.
The idea is to keep all the db files on a mounted folder. While on Mac OS it works just fine - on the Windows machine I am getting an error every time MariaDB attempts to start. The weird part is that it's actuall... | You need to add this option when starting MariaDB (in Dockerfile's CMD or docker-compose command:):
--innodb-flush-method=fsync
It's documented here: https://github.com/docker-library/mariadb/issues/95
If it does not help, also add --innodb-use-native-aio=0.
Asynchronous I/O are not supported on Windows nor Mac OS X:
... | MariaDB | 40,109,596 | 11 |
I'm trying to upgrade mysql in xamp. I'm using laravel which requires mariaDB v10.2.2. So I downloaded the latest msi package from the mariaDB website. Now I followed following points to install the same:
Install MySQL to C:\TEMP.
Make old installation folder to mysql_old.
copy the following folders "bin, include, lib... | Simply remove this line from my.ini:
innodb_additional_mem_pool_size = 2M
It was "deprecated in MySQL 5.6.3, are removed in MySQL 5.7.4."
(If my notes are correct, it has been "unused" since 4.1.0!)
| MariaDB | 42,453,124 | 11 |
With MariaDB 10.2 it's possible to define default value for Datetime e.g. created and lastModified.
How I should access this columns as readonly field? Because this values should only be under control of the database and should not be modified from code, but I want read access to this property in code.
| It's simple. Just set the insertable and updatable attributes to false.
@Column(
name = "created_on",
insertable = false,
updatable = false
)
private Timestamp createdOn;
| MariaDB | 45,430,983 | 11 |
I'm very new for docker, now I am trying to run django with mariadb in docker through docker-compose, but I always get this error:
I use Docker version 17.09.1-ce, build 19e2cf6, docker-compose version 1.18.0, build 8dd22a9
django.db.utils.OperationalError: (2003, 'Can\'t connect to MySQL
server on \'mariadb55\' (11... | Finally, I figured it out!
The key point is, just as @SangminKim said, I need to use 3306 not 3302 in settings.py, and use db as HOST not 127.0.0.1.
So this is my docker-compose.yml file now:
version: '3'
services:
db:
image: mariadb:5.5
restart: always
environment:
- MYSQL_HOST=localhost
- M... | MariaDB | 47,979,270 | 11 |
Question
Is any alternatives of MySQL RANDOM_BYTES(len) or MSSQL CRYPT_GEN_RANDOM(len) available in MariaDB?
I read through their documentation, but I only found is rand(len), which is not cryptographically secure in generating random bytes.
Issues
Currently released version of MariaDB (10.3) does not support RANDOM_B... | It seems RANDOM_BYTES(length) is available since 10.10.0 (preview release) Check the documentation.
| MariaDB | 53,149,125 | 11 |
I want to query something with SQL's like query:
SELECT * FROM users WHERE name LIKE '%m%'
How can I achieve the same in MongoDB? I can't find an operator for like in the documentation.
| That would have to be:
db.users.find({"name": /.*m.*/})
Or, similar:
db.users.find({"name": /m/})
You're looking for something that contains "m" somewhere (SQL's '%' operator is equivalent to regular expressions' '.*'), not something that has "m" anchored to the beginning of the string.
Note: MongoDB uses regular exp... | MongoDB | 3,305,561 | 1,948 |
I have tried to puzzle out an answer to this question for many months while learning pandas. I use SAS for my day-to-day work and it is great for it's out-of-core support. However, SAS is horrible as a piece of software for numerous other reasons.
One day I hope to replace my use of SAS with python and pandas, but I ... | I routinely use tens of gigabytes of data in just this fashion
e.g. I have tables on disk that I read via queries, create data and append back.
It's worth reading the docs and late in this thread for several suggestions for how to store your data.
Details which will affect how you store your data, like:
Give as much de... | MongoDB | 14,262,433 | 1,183 |
I have a MongoDB collection with documents in the following format:
{
"_id" : ObjectId("4e8ae86d08101908e1000001"),
"name" : ["Name"],
"zipcode" : ["2223"]
}
{
"_id" : ObjectId("4e8ae86d08101908e1000002"),
"name" : ["Another ", "Name"],
"zipcode" : ["2224"]
}
I can currently get documents that match a spec... | There's a more efficient way to do this in MongoDB 2.2+ now that you can use numeric array indexes (0 based) in query object keys.
// Find all docs that have at least two name array elements.
db.accommodations.find({'name.1': {$exists: true}})
You can support this query with an index that uses a partial filter express... | MongoDB | 7,811,163 | 977 |
What's the easiest way to do this from my bash prompt?
| Like this:
mongo <dbname> --eval "db.dropDatabase()"
More info on scripting the shell from the command line here: https://docs.mongodb.com/manual/tutorial/write-scripts-for-the-mongo-shell/#scripting
Edit:
In Mongo 6.0 mongo was removed and replaced with mongosh which has to be installed separately. More info here: ht... | MongoDB | 8,857,276 | 939 |
In the MongoDB shell, how do I list all collections for the current database that I'm using?
| You can do...
JavaScript (shell):
db.getCollectionNames()
Node.js:
db.listCollections()
Non-JavaScript (shell only):
show collections
The reason I call that non-JavaScript is because:
$ mongo prodmongo/app --eval "show collections"
MongoDB shell version: 3.2.10
connecting to: prodmongo/app
2016-10-26T19:34:34.886-04... | MongoDB | 8,866,041 | 914 |
All of my records have a field called "pictures". This field is an array of strings.
I now want the newest 10 records where this array IS NOT empty.
I've googled around, but strangely enough I haven't found much on this.
I've read into the $where option, but I was wondering how slow that is to native functions, and if ... | If you also have documents that don't have the key, you can use:
ME.find({ pictures: { $exists: true, $not: {$size: 0} } })
MongoDB doesn't use indexes if $size is involved, so here is a better solution:
ME.find({ pictures: { $exists: true, $ne: [] } })
If your property can have invalid values (like null boolean or o... | MongoDB | 14,789,684 | 778 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.