61689

MySQL duplicates with CONCAT error 1548 - Cannot load from mysql.proc. The table is probably corrupt

Question:

i have this query witch concatenates firstname with last name and then find the duplicates:

SELECT import.*, import.CONCAT(nume,' ',prenume) full2 FROM import INNER JOIN (SELECT CONCAT(nume,' ',prenume) full,COUNT(*) FROM import WHERE users_id=1 GROUP BY full HAVING COUNT(*)>1) as t2 ON import.full2 = t2.full WHERE users_id=1

i think the sql syntax is correct but i get the error: 1548 - Cannot load from mysql.proc. The table is probably corrupted

is there any problem with the 5.1.59 mysql version?

Answer1:

Do that

CONCAT(import.nume,' ',import.prenume) full2

instead of

import.CONCAT(nume,' ',prenume) full2 <h2>Update</h2>

Try that:

SELECT t1.*, CONCAT(t1.nume,' ',t1.prenume) full2 FROM import t1 INNER JOIN (SELECT CONCAT(i2.nume,' ',i2.prenume) `full`, COUNT(*) FROM import i2 WHERE i2.users_id=1 GROUP BY `full` HAVING COUNT(*)>1) as t2 ON full2 = t2.`full` WHERE users_id=1

Answer2:

Change

SELECT import.*, import.CONCAT(nume,' ',prenume) full2

to

SELECT import.*, CONCAT(import.nume,' ',import.prenume) as full2

Note the change to the CONCAT statement and the as addition for using column aliases

as you are using a single table you could remove the import. from the column list ... alternatively you could use a table alias

SELECT i.*, CONCAT(i.nume,' ',i.prenume) as full2 FROM import i WHERE i.user_id = 1

as an example.

<a href="http://dev.mysql.com/doc/refman/5.0/en/select.html#id742747" rel="nofollow">See the MySQL docs here on using the AS alias</a>

Answer3:

Examines all tables in all databases for incompatibilities with the current version of MySQL Server:

mysql_upgrade -uroot -p

<a href="http://dev.mysql.com/doc/refman/5.0/en/mysql-upgrade.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.0/en/mysql-upgrade.html</a>

Recommend

  • How to perform a left join in SQLALchemy?
  • TypeScript Mapped Types: Get element type of array
  • Is there a method to list all objects such as VIEWs that use a SYNONYM?
  • Disable reverse path filtering from Linux kernel space
  • Populate checkbox from database
  • wrong number of arguments (0 for 1) while create my user
  • Is Android development possible on netbooks? [closed]
  • Is there a way to ensure one object reference per record in an ActiveRecord hierarchy?
  • Sort by a column in a union query in SqlAlchemy SQLite
  • Ruby: Why does this way of using map throw an error?
  • How to make stdcall from Go
  • How to enable large page memory for the JVM?
  • ZipList with Scalaz
  • Alamofire and Reachability.swift not working on xCode8-beta5
  • MYSQ & MVC3 SQL connection error \\ ProviderManifestToken but I am using MySQL
  • Question about instantiating object
  • C# program and C++ DLL compiled for 32-bit system crash on 64-bit system
  • Web.config system.webserver errors
  • pyodbc doesn't report sql server error
  • Loading .coffee files via a view in Rails
  • Create DicomImage from scratch using Dcmtk
  • Email verification using google app script and google forms
  • Moving mysql files across servers
  • PHPUnit_Framework_TestCase class is not available. Fix… - Makegood , Eclipse
  • PHP - How to update data to MySQL when click a radio button
  • Counter field in MS Access, how to generate?
  • How to check if every primary key value is being referenced as foreign key in another table
  • Function pointer “assignment from incompatible pointer type” only when using vararg ellipsis
  • 0x202A in filename: Why?
  • Comma separated Values
  • Hits per day in Google Big Query
  • FormattedException instead of throw new Exception(string.Format(…)) in .NET
  • File not found error Google Drive API
  • Linking SubReports Without LinkChild/LinkMaster
  • XCode 8, some methods disappeared ? ex: layoutAttributesClass() -> AnyClass
  • Observable and ngFor in Angular 2
  • How to Embed XSL into XML
  • UserPrincipal.Current returns apppool on IIS
  • Conditional In-Line CSS for IE and Others?
  • How to load view controller without button in storyboard?